dataset.Join

Object Description

Encapsulates joined records used in the dataset.

Use dataset.createJoin(options) to create this object.

For more information about using joins in SuiteAnalytics, see Joining Record Types in a Dataset.

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. Also see the Tutorial: Creating a Dataset Using the Workbook API topic.

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

General Notices