Category Object Members in SuiteScript for Data Visualization
Category object members in SuiteScript facilitate data visualization, including axis settings, root dimensions, and sort definitions.
TL;DR Opening
The Category object in SuiteScript plays a crucial role in data visualization by providing essential members such as axis settings, root dimensions, and sort definitions. This article delves into these components, their respective types, and how they can be utilized in scripts.
What Are Category Object Members?
Category object members in SuiteScript allow developers to customize data visualization aspects within workbooks. Understanding these members provides a foundational knowledge for efficiently using the N/workbook module in SuiteScript.
Category Object Members Overview
The following table summarizes the available members of the Category object:
| Member Name | Return Type/Value Type | Supported Script Types | Description |
|---|---|---|---|
Category.axis | workbook.ChartAxis | Server scripts | The axis of the category. |
Category.root | workbook.DataDimension or workbook.Section | Server scripts | The section or data dimension for the x-axis. |
Category.sortDefinitions | workbook.SortDefinition[] | Server scripts | The sort definitions of the category. |
Individual Member Details
1. Category.axis
The Category.axis member represents the axis of the category in a chart. This is essential for structuring how data is displayed. If an incorrect parameter type is specified, it throws the error code WRONG_PARAMETER_TYPE.
2. Category.root
This member outlines the primary section or data dimension associated with the x-axis. It can either be a data dimension or a section.
3. Category.sortDefinitions
This array holds the definitions used for sorting category data, allowing for customized data views based on specific criteria.
Code Sample: Using Category Members
To illustrate the application of category members in SuiteScript, consider the following code snippet:
1// Load a workbook2var myWorkbook = workbook.load({3 id: myWorkbookId4});5 6// Access the category axis7log.audit({8 title: 'Category.axis = ',9 details: myWorkbook.charts[0].category.axis10});This code demonstrates how to load a workbook and access the category axis for logging. For a complete script example, refer to the N/workbook Module Script Samples.
Who This Affects
The following roles may benefit from understanding the Category object members:
- SuiteScript Developers: For building and customizing reports and visualizations.
- Business Analysts: To analyze and interpret data within suite charts.
Key Takeaways
- The Category object provides critical members for data visualization in SuiteScript.
- Understanding these members is essential for creating effective data visualizations.
- The
N/workbookmodule facilitates rich data representation and analysis through SuiteScript.
Frequently Asked Questions (4)
What script types support the Category object members in SuiteScript?
What error is thrown if an incorrect parameter type is specified for the Category.axis member?
How can I log the Category.axis value in a SuiteScript?
Can the Category.root member be a data dimension or a section in SuiteScript?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
