Workbook Object Members Overview in SuiteScript

The Workbook object in SuiteScript allows for data analysis with pivot tables and custom tables, enhancing reporting capabilities.

·2 min read·View Oracle Docs

TL;DR

The Workbook object in SuiteScript provides developers with essential functionalities for analyzing datasets through customizable workbooks, including supporting methods for data manipulation and retrieval. This feature is pivotal for creating dynamic reports within NetSuite.

What is the Workbook Object?

The Workbook object serves as a crucial component in SuiteScript, designed for analyzing the results of dataset queries. By using different components such as table views and pivots, it allows developers to create workbooks that can incorporate multiple datasets. A single dataset can be the foundation for various workbooks, facilitating diverse analytical perspectives.

Members of the Workbook Object

The Workbook object comprises several members, including methods and properties which facilitate its functionalities. Below is a list of available members:

Member NameTypeReturn TypeSupported Script TypesDescription
Workbook.runPivot(options)Methodworkbook.PivotIntersection[]Server scriptsExecutes a pivot in the workbook and returns intersections.
Workbook.descriptionPropertystringServer scriptsProvides the description of the workbook.
Workbook.idPropertystringServer scriptsThe unique ID of the workbook.
Workbook.namePropertystringServer scriptsThe name assigned to the workbook.
Workbook.pivotsPropertyworkbook.Pivot[]Server scriptsLists the pivots included in the workbook.
Workbook.tablesPropertyworkbook.Table[]Server scriptsDetails the tables present in the workbook.

Method Functionality: runPivot

The runPivot(options) method is pivotal for executing pivots within a workbook. It returns an array of pivot intersections, enabling users to interact with the analytical data effectively. Below is the syntax:

suitescript
1var myWorkbook = workbook.load({
2 id: myWorkbookId,
3});
4var myResultSet = myWorkbook.runPivot({
5 id: myTableId,
6});
7log.debug({
8 title: 'My Run Pivot Result Set: ',
9 details: myResultSet
10});

Usage and Governance

This method incurs a governance cost of 10 units for each intersection returned, so it's important to consider performance and cost when designing workflows that leverage this functionality.

Who This Affects

  • Developers: Leverage the Workbook object in SuiteScripts for custom reporting.
  • Administrators: Streamline data analysis and reporting processes utilizing this object.

Key Takeaways

  • The Workbook object facilitates complex data analysis within NetSuite.
  • Developers can utilize various members to create, manipulate, and extract data from workbooks.
  • Efficient data retrieval methods like runPivot() enable advanced reporting functionalities.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Can the Workbook object be used in client scripts like Suitelets or User Event scripts?
No, the Workbook object's methods and properties are only supported in server scripts, as indicated in the member specifications.
How does the runPivot() method affect script governance in NetSuite?
The runPivot() method incurs a governance cost of 10 units for each intersection returned. This requires careful consideration of performance and cost when integrating it into workflows.
Does the Workbook object allow for the inclusion of multiple datasets in a single workbook?
Yes, the Workbook object allows a single workbook to incorporate multiple datasets, thus facilitating diverse analytical perspectives.
Are there any unique identifiers associated with each workbook created using the Workbook object?
Yes, each workbook has a unique ID accessible through the `Workbook.id` property, which is helpful for referencing and managing workbooks.
Source: Workbook Object Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Projects

View all Projects articles →