Dataset.save(options)

Note:

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

Method Description

Saves a dataset.

When you save a dataset, you must provide a name, which will appear in the SuiteAnalytics Workbook UI. Optionally, you can provide a description and an ID. If you do not provide an ID, one is generated automatically.

The object returned from this method includes only the id property and its value.

Returns

Object

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

10

Module

N/dataset Module

Parent Object

dataset.Dataset

Sibling Object Members

Dataset Object Members

Since

2020.2

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.name

string | workbook.Expression

required

The name of the dataset.

options.description

string | workbook.Expression

optional

The description of the dataset.

options.id

string

optional

The ID of the dataset.

Errors

Error Code

Thrown If

INVALID_ID_PREFIX

The value of the options.id parameter does not start with custdataset.

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.

            // Add additional code
...
// Create and save a new dataset
var myNewDataset = dataset.create({
    type: 'transaction',
    columns: [myDatasetColumns]
});
myNewDataset.save({
    name: 'My Dataset',
    description: 'This is a sample dataset.',
    id: 'custdataset_myDataset'
});

...
// Add additional code 

          

Related Topics

dataset.Dataset
N/dataset Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices