dataset.Join

Note:

The content in this help topic applies to SuiteScript 2.x.

Object Description

Encapsulates joined records used in the dataset.

This object is created using the dataset.createJoin(options) method.

For more information about using joins in SuiteAnalytics, see Joining Record 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.x Script Types.

Module

N/dataset Module

Methods and Properties

Join Object Members

Since

2020.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/dataset Module Script Samples.

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

          

Related Topics

N/dataset Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices