Modules

filter

 

Objects/Functions

module (N/query)

SuiteScript 2.0

Query.autoJoin(options)

{Query}.autoJoin({fieldId: {string*}})

N/query Module
Query.autoJoin()
Method Description: Creates a join relationship. Use the method query.create(options) to create your initial query definition (query.Query). The initial query definition uses one query type. For available query types, see query.Type. After you create the initial query definition, use Query.autoJoin(options) to create your first join (query.Component). Then use Component.autoJoin(options) to create each subsequent join (query.Component). This method is a shortcut for the chained Query.root and Component.autoJoin(options): Query.root.join(options). The Query.root property references the root component, which is a query.Component object. The N/query module supports the same record types that are supported by the SuiteAnalytics Workbook interface. For more information, see Available Record Types.
Returns: query.Component
Supported Script Types: Client and server scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/query Module
Parent Object: query.Query
Sibling Object Members: Query Object Members
Since: 2018.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Query.autoJoin(options)

Example:

// Code Example 1
// 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

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