Column.alias

Note:

The content in this help topic pertains to SuiteScript 2.0.

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

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/query Module Script Samples.

            // 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 

          

Related Topics

query.Query
N/query Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices