Modules

filter

 

Objects/Functions

module (N/query)

SuiteScript 2.0

Query.columns

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

N/query Module
Query.columns
Property Description: An array of result columns (query.Column objects) returned from the query. The query.Column object is the equivalent of the search.Column object in the N/search Module. The query.Column object describes a field type (column) that is returned from the query results. To create columns: Use Query.createColumn(options) to create conditions on the initial query definition created with query.create(options). Use Component.createColumn(options) to create conditions on the join relationships created with Query.autoJoin(options) and Component.autoJoin(options). Assign all created columns as array values to Query.columns. For an example, see Syntax.
Type: query.Column[]
Module: N/query Module
Parent Object: query.Query
Sibling Object Members: Query Object Members
Since: 2018.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Query.columns

Example:

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

var mySalesRepJoin = myCustomerQuery.autoJoin({
fieldId: 'salesrep'
});

myCustomerQuery.columns = [
myCustomerQuery.createColumn({
fieldId: 'entityid'
}),
mySalesRepJoin.createColumn({
fieldId: 'firstname'
}),
mySalesRepJoin.createColumn({
fieldId: 'email'
})
];
//...
// Add additional code

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