Category Object Members in SuiteScript for Data Visualization

Category object members in SuiteScript facilitate data visualization, including axis settings, root dimensions, and sort definitions.

·2 min read·View Oracle Docs

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 NameReturn Type/Value TypeSupported Script TypesDescription
Category.axisworkbook.ChartAxisServer scriptsThe axis of the category.
Category.rootworkbook.DataDimension or workbook.SectionServer scriptsThe section or data dimension for the x-axis.
Category.sortDefinitionsworkbook.SortDefinition[]Server scriptsThe 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:

suitescript
1// Load a workbook
2var myWorkbook = workbook.load({
3 id: myWorkbookId
4});
5
6// Access the category axis
7log.audit({
8 title: 'Category.axis = ',
9 details: myWorkbook.charts[0].category.axis
10});

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/workbook module facilitates rich data representation and analysis through SuiteScript.

Frequently Asked Questions (4)

What script types support the Category object members in SuiteScript?
Category object members are supported in server scripts.
What error is thrown if an incorrect parameter type is specified for the Category.axis member?
If an incorrect parameter type is specified for the Category.axis member, it throws the error code WRONG_PARAMETER_TYPE.
How can I log the Category.axis value in a SuiteScript?
You can log the Category.axis value by accessing it through myWorkbook.charts[0].category.axis and using the log.audit function as shown in the code sample.
Can the Category.root member be a data dimension or a section in SuiteScript?
Yes, the Category.root member can be either a data dimension or a section, depending on its definition for the x-axis.
Source: Category 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 →