DataDimension Object Members

Explore the DataDimension object members in SuiteScript, including properties like children and items for effective workbook customization.

·2 min read·View Oracle Docs

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 NameReturn TypeSupported Script TypesDescription
DataDimension.childrenArray<workbook.DataDimension or workbook.Section>Server scriptsRetrieves the children of the data dimension.
DataDimension.itemsArray<workbook.DataDimensionItem>Server scriptsProvides the items belonging to the data dimension.
DataDimension.totalLinestringServer scriptsDefines 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:

suitescript
1// Creating a DataDimension object
2var myDataDimension = workbook.createDataDimension({
3 items: [myDataDimensionItem],
4 children: [myMeasure],
5 totalLine: workbook.TotalLine.FIRST_LINE
6});
7
8// Accessing the children property
9var 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[] or workbook.Section[].

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?
No, the DataDimension object is only available in server-side scripts according to the documentation.
What should I do if I encounter the 'WRONG_PARAMETER_TYPE' error with DataDimension?
This error occurs if a value assigned is not a valid workbook.DataDimension[] or workbook.Section[]. Ensure the correct types are used when setting properties for the DataDimension object.
Can I use the DataDimension object to create pivot axes in SuiteScript workbooks?
Yes, the DataDimension object is versatile and can be used to create pivot axes, among other elements like categories and legends.
How can I create a DataDimension object with specific items and children?
You can create a DataDimension object using the workbook.createDataDimension(options) method, specifying parameters like items and children within the options object.
Source: DataDimension 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 Platform

View all Platform articles →