dataset.create(options)
Method Description |
Creates a dataset based on a record type. A dataset can include columns and conditions (criteria). |
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 |
---|---|---|---|
|
optional |
The fields (columns) in the dataset. |
|
|
optional |
The condition (criteria to be applied to the dataset. A condition can have children which are combined using the appropriate operator (AND or OR) to produce the criteria used. |
|
|
string |
optional |
The description of the dataset. |
|
string |
optional |
The script ID of the dataset. |
|
string |
optional |
The name of the dataset. |
|
string |
required |
The internal ID for the record type on which to build the dataset. Use the Records Catalog to find the Internal ID of scriptable records. |
Errors
Error Code |
Thrown If |
---|---|
|
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 Dataset
var myDataset = dataset.create({
type: 'transaction'
});
// Create a comprehensive (full) Dataset
var myDataset = dataset.create({
type: 'transaction',
name: 'My Transaction Dataset',
id: 'trans_dataset',
description: 'My comprehensive transaction dataset that includes columns and a condition',
condition: myCondition, // Create this using dataset.createCondition
columns: myColumns // Create this using dataset.createColumn
});
...
// Add additional code