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
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- Set Sublist Field Values in SuiteScript 2.x for Record Management
Set sublist field values in SuiteScript 2.x for effective record management using standard and dynamic modes.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category