DataDimension Object Members
Explore the DataDimension object members in SuiteScript, including properties like children and items for effective workbook customization.
The DataDimension object provides essential properties for manipulating data dimensions in SuiteScript workbooks. It allows developers to create dynamic categories, legends, and pivot axes efficiently, making it crucial for those utilizing SuiteScript in reporting and analytics.
What Members Are Available for DataDimension?
The following members are part of the workbook.DataDimension object:
| Member Name | Return Type | Supported Script Types | Description |
|---|---|---|---|
DataDimension.children | Array<workbook.DataDimension or workbook.Section> | Server scripts | Retrieves the children of the data dimension. |
DataDimension.items | Array<workbook.DataDimensionItem> | Server scripts | Provides the items belonging to the data dimension. |
DataDimension.totalLine | string | Server scripts | Defines the formatting option for the total line. Set this value using workbook.TotalLine. |
Object Description
The DataDimension object is versatile and can be utilized to create categories, legends, pivot axes, dimension selectors, or sections. You can create this object via the workbook.createDataDimension(options) method, which accepts various parameters to customize the dimension’s behavior.
Code Sample
The following code demonstrates how to create a DataDimension object with its members:
1// Creating a DataDimension object2var myDataDimension = workbook.createDataDimension({3 items: [myDataDimensionItem],4 children: [myMeasure],5 totalLine: workbook.TotalLine.FIRST_LINE6});7 8// Accessing the children property9var theChildren = myDataDimension.children;Supported Script Types
The DataDimension object is only available in server-side scripts. Ensure to refer to the SuiteScript 2.x Script Types for more information on applicable environments.
Error Handling
If improper values are assigned to the properties of the DataDimension, an error might be thrown:
- Error Code:
WRONG_PARAMETER_TYPE- Thrown If: The value specified is not a valid
workbook.DataDimension[]orworkbook.Section[].
- Thrown If: The value specified is not a valid
By understanding and correctly utilizing the DataDimension object members, developers can enhance their workbooks significantly, ensuring better data visualization and reporting capabilities.
Key Takeaways
- The DataDimension object is vital for creating structured data presentations in SuiteScript workbooks.
- It includes properties for children and items, which aid in hierarchical data representation.
- Proper error handling, especially with parameter types, is crucial for robust script development.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Is the DataDimension object available for use in client-side scripts?
What should I do if I encounter the 'WRONG_PARAMETER_TYPE' error with DataDimension?
Can I use the DataDimension object to create pivot axes in SuiteScript workbooks?
How can I create a DataDimension object with specific items and children?
Was this article helpful?
More in Platform
- Style Object Members for Workbook API in NetSuite
The Style object provides customizable properties for workbook formatting in NetSuite, enhancing report and visualization functionality.
- Asynchronous HTTP Requests with SuiteScript Promises
Use SuiteScript to send asynchronous HTTP requests with promises for efficient error handling and response processing.
- Setting Sublist Field Values in SuiteScript
Set values for sublist fields in SuiteScript using the setSublistValue method. Understand required parameters and error handling.
- In This Help Topic
Explore N/log module guidelines, log levels, and script execution logs for efficient logging in SuiteScript.
Advertising
Reach Platform Professionals
Put your product in front of NetSuite experts who work with Platform every day.
Sponsor This Category