Modules

filter

 

Objects/Functions

module (N/query)

SuiteScript 2.0

Column.alias

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=Column.alias for more information.

N/query Module
Column.alias
Property Description: An alias for this column. An alias is an alternate name for a column, and the alias is used in mapped results. In general, the alias is an optional property. If you want to use mapped results in your script, the alias is required. To use mapped results, you must specify an alias in the following situations: You must specify an alias for a column when the column uses a formula. You must specify an alias when two columns in a joined query use the same field ID. For example, many record types include the entity field ID. If you join two record types that use the entity field ID, and you use the entity field ID to create result columns for both record types, you must specify an alias for one of the columns. This alias distinguishes the two columns that have the same field ID. This property is set when Query.createColumn(options) or Component.createColumn(options) is executed.
Type: string
Module: N/query Module
Parent Object: query.Column
Sibling Object Members: Column Object Members
Since: 2019.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Column.alias

Example:

// Code Example 1
// Add additional code
//...
var myTransactionQuery = query.create({
type: query.Type.TRANSACTION
});

var myAliasColumn = myTransactionQuery.createColumn({
fieldId: 'amount',
aggregate: query.Aggregate.AVERAGE,
alias: 'sunkcostamount'
});

myTransactionQuery.columns = [myAliasColumn];

var theAlias = myAliasColumn.alias;
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156336566313.html