Datasets

Note:

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

Datasets are the basis for all workbook visualizations in your account. In a dataset, you combine the fields of a root record type and any joined related record types to create a query. The record types and fields that you can access are based on the features enabled in your account and the permissions assigned to the role you use to log in to NetSuite.

For more information about datasets in SuiteAnalytics Workbook, see Defining a Dataset.

To create a dataset, use dataset.create(options). This method creates a dataset.Dataset object. When you use this method, only the type parameter is required, and it specifies the root record type that the dataset is based on. For this parameter, you can load the N/query module and use values from the query.Type enum:

          var myDataset = dataset.create({
    type: query.Type.CUSTOMER
}); 

        

Alternatively, if you do not want to load the N/query module, you can use the string equivalents of the query.Type for this parameter:

          var myDataset = dataset.create({
    type: 'customer'
}); 

        

Optionally, you can provide the following parameters for dataset.create(options):

          var myDataset = dataset.create({
    columns: myColumns,
    condition: myCondition,
    type: 'customer'
}); 

        

Related Topics

Workbooks
Workbook API Concepts

General Notices