query.Query
Object Description |
The
The query definition always contains at least one query.Component object. The query.Component object encapsulates one component of the query definition. Each new component is created as a child to the previous component, and all components exist as children to the query definition. You can think of a component as a building block; each new component builds on the previous component created. The last component created encapsulates the relationship between it and all of its parent components. Queries with joins contain multiple components. The query definition contains a child query.Component object for each of the following:
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Module |
|
Methods and Properties |
|
Since |
2018.1 |
Syntax
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 myEntityJoin = myTransactionQuery.autoJoin({
fieldId: 'entity'
});
myTransactionQuery.columns = [
myEntityJoin.createColumn({
fieldId: 'subsidiary'
})
];
myTransactionQuery.sort = [
myTransactionQuery.createSort({
column: myTransactionQuery.columns[0],
ascending: false
})
];
var results = myTransactionQuery.runPaged({
pageSize: 10
});
...
// Add additional code