datasetLink.create(options)
Method Description |
Links two datasets using a common column expression. To link two datasets, both datasets must include a column that shares common data, such as a date. You use Dataset.getExpressionFromColumn(options) to obtain expressions for each column, then you specify these expressions (and the datasets they are part of) when you call |
Returns |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Module Members |
|
Since |
2021.2 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
required |
The datasets to link. |
|
|
Array<workbook.Expression[]> |
required |
The column expressions to use to link the datasets. |
|
string |
optional |
The ID of the linked dataset. If you do not provide a value for this parameter, an ID is generated automatically and assigned to the DatasetLink.id property of the returned datasetLink.DatasetLink object. |
Errors
Error Code |
Thrown If |
---|---|
|
The value of the |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script sample, see N/datasetLink Module Script Sample.
// Add additional code
...
var myDatasetLink = datasetLink.create({
datasets: [firstDataset, secondDataset],
expressions: [[columnExpInFirstDataset, columnExpInSecondDataset]],
id: 'myDatasetLinkId'
});
...
// Add additional code