dataset.Dataset
Object Description |
Encapsulates the entire dataset, including columns, conditions, and joins. Use dataset.create(options) to create this object. |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Module |
|
Methods and Properties |
|
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 Dataset
var myDataset = dataset.create({
type: 'transaction'
});
// Create a comprehensive (full) Dataset
var myDataset = dataset.create({
type: 'transaction',
name: 'My Transaction Dataset',
id: 'custdataset_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
});
// Load a dataset and view its Dataset (in the log)
var myDataset = dataset.load({
id: '1' // Replace with a valid ID value for your account
});
var myDatasetDataset = myDataset.Dataset;
// Note that some Dataset properties may be empty/null based on the loaded dataset
log.audit({
title: 'Dataset columns = ',
details: myDatasetDataset.columns
});
log.audit({
title: 'Dataset condition = ',
details: myDatasetDataset.condition
});
log.audit({
title: 'Dataset description = ',
details: myDatasetDataset.description
});
log.audit({
title: 'Dataset id = ',
details: myDatasetDataset.id
});
log.audit({
title: 'Dataset name = ',
details: myDatasetDataset.name
});
log.audit({
title: 'Dataset type = ',
details: myDatasetDataset.type
});
...
// Add additional code