dataset.createJoin(options)
Method Description |
Creates a dataset join. Multi-level, inverse, and polymorphic joins can be created. Joins can be used when you create a dataset column. For more information about using joins in a dataset in SuiteAnalytics, see the help topic, Joining Record Types in a Dataset. |
Returns |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Module Members |
|
Since |
2020.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
string |
required |
The ID of the record field for the join. When you perform a join, you must specify the field to be used to perform the join. For example, consider a transaction record. Transaction records can be joined to customer records using the entity field on the transaction record. If you joined a transaction record to a customer record in this way, the value of this property is 'entity'. |
|
optional |
The existing join used to a create multi-level join. Use this parameter only if a child join exists with the current join as its parent. |
|
|
string |
optional |
The internal ID for the source record type for the join used to create an inverse join. Use the Records Catalog to find the Internal ID of scriptable records. |
|
string |
optional |
The polymorphic target of the join. |
Errors
Error Code |
Thrown If |
---|---|
|
Both the |
Syntax
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
});
...
// Add additional code