Modules
Objects/Functions
SuiteScript 2.0
{workbook}.create({chartDefinitions: {workbook.ChartDefinition[]},description: {string},name: {string},pivotDefinitions: {workbook.PivotDefinition[]},tableDefinitions: {workbook.TableDefinition[]}})
N/workbook Module
workbook.create()
Method Description:
Creates a new workbook. Workbooks are where you analyze the results of your dataset queries using different components, such as table views, pivot tables, and charts. All workbooks are based on a dataset, and a single dataset can be used as the basis for multiple workbooks. A workbook can include an ID, a name, a description, pivot definitions, chart definitions, and table definitions.
Returns:
workbook.Workbook
Supported Script Types:
Server scripts
For more information, see SuiteScript 2.0 Script Types.
Governance:
None
Module:
N/workbook Module
Sibling Module Members:
N/workbook Module Members
Since:
2020.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=workbook.create(options)
Example:
// Code Example 1
// Add additional code
//...
// Create an empty workbook
var myWorkbook = workbook.create({});
// Create a workbook with just a name and description
var myWorkbook = workbook.create({
name: 'My Workbook',
description: 'My starter workbook'
});
// Create a workbook with a table
var myWorkbook = workbook.create({
tableDefinitions: [myTableDefinition]
});
// Create a workbook with a pivot
var myWorkbook = workbook.create({
pivotDefinitions: [myPivotDefinition]
});
// Create a workbook with a chart
var myWorkbook = workbook.create({
chartDefinitions: [myChartDefinition]
});
// Create a comprehensive workbook
var myWorkbook = workbook.create({
name: 'My Big Workbook',
description: 'My workbook that contains everything',
tableDefinitions: [myTableDefinition],
chartDefinitions: [myChartDefinition],
pivotDefinitions: [myPivotDefinition]
});
//...
// Add additional code
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_159008744522.html