Modules

filter

 

Objects/Functions

module (N/dataset)

SuiteScript 2.0

dataset.Join

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

N/dataset Module
dataset.Join
Object Description: Encapsulates joined records used in the dataset. This object is created using the dataset.createJoin(options) method. For more information on using joins in SuiteAnalytics, see Joining Records Types in a Dataset. For a complete list of this object’s properties, see Join Object Members.
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Module: N/dataset Module
Methods and Properties: Join Object Members
Since: 2020.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=dataset.Join

Example:

// Code Example 1
// Add additional code
//...
// Create a basic Join
var myNameJoin = dataset.createJoin({
fieldId: 'name'
});

// Create an inverse Join
var myInverseJoin = dataset.createJoin({
fieldId: 'phone',
source: 'contact'
});

// Create a polymorphic Join
var myPolymorphicJoin = dataset.createJoin({
fieldId: 'phone',
target: 'entity'
});

// Create a multi-level Join
var myMultiLevelJoin = dataset.createJoin({
fieldId: 'phone',
join: myNameJoin
});

// Load a dataset that includes a column with a join and view its Join (in the log)
var myDataset = dataset.load({
id: myDatasetId // Replace with a valid ID value for your account
});
var myJoin = myDataset.columns[0].join;

// Note that some Join properties may be empty/null based on the loaded dataset
log.audit({
title: 'Join fieldId = ',
details: myJoin.fieldId
});
log.audit({
title: 'Join source = ',
details: myJoin.source
});
log.audit({
title: 'Join target = ',
details: myJoin.target
});
log.audit({
title: 'Join join = ',
details: myJoin.join
});
//...
// Add additional code

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