DimensionSelector Object Members in SuiteScript

The DimensionSelector object in SuiteScript facilitates creating path selectors, filters, and sort definitions for enhanced data manipulation.

·2 min read·View Oracle Docs

The DimensionSelector object is a crucial component in SuiteScript that enables developers to create various selectors and filters for enhancing data workflows. It is extensively utilized within methods for defining how data dimensions are represented and manipulated within SuiteAnalytics workbooks.

What is the DimensionSelector Object?

The DimensionSelector object is employed when creating path selectors, sort definitions, conditional filters, limiting filters, or measure sorts. It is initialized using the workbook.createDimensionSelector(options) method. The object forms part of the N/workbook SuiteScript module.

Utilizing the DimensionSelector, developers can create tailored data representations and refine how analytics are executed in their custom applications.

DimensionSelector Object Members

The DimensionSelector includes several members that contribute to its functionality:

Member NameTypeSupported Script TypesDescription
DimensionSelector.dimensionworkbook.DataDimension, workbook.SectionServer scriptsRepresents the dimension of the selector.

Supported Script Types

This object is applicable in Server Scripts. For more details, refer to the SuiteScript 2.x Script Types.

Syntax Example 1: Creating a Dimension Selector

Below is a syntax example showcasing how to create a DimensionSelector object:

suitescript
var myDimensionSelector = workbook.createDimensionSelector({
dimension: myDataDimension
});

Syntax Example 2: Accessing the Dimension Property

Here's another code sample demonstrating how to access the dimension property of a DimensionSelector object:

suitescript
var theDimension = myDimensionSelector.dimension;

Error Handling

During implementation, developers should be aware of potential errors. For instance, if an incorrect parameter type is set for the dimension, the following error will be thrown:

  • Error Code: WRONG_PARAMETER_TYPE
    • Condition: The value specified is not a workbook.DataDimension or a workbook.Section.

Knowing how to handle these errors effectively is crucial for maintaining script integrity and avoiding runtime issues.

Conclusion

The DimensionSelector object in SuiteScript is essential for creating sophisticated data selectors that enhance the analysis capabilities of SuiteAnalytics workbooks. By understanding its members and usage, developers can leverage its full potential in their applications.

Key Takeaways

  • The DimensionSelector is key for creating effective analytics in SuiteScript.
  • It is used to define dimensions for various selectors and filters.
  • Error handling is vital to ensure proper object usage in scripts.

Frequently Asked Questions (4)

Does the DimensionSelector object apply to both server and client scripts?
No, the DimensionSelector object is applicable only in server scripts as specified in the article.
How is the DimensionSelector object initialized in SuiteScript?
The DimensionSelector object is initialized using the workbook.createDimensionSelector(options) method.
What happens if an incorrect parameter type is used for the dimension property in DimensionSelector?
If an incorrect parameter type is set for the dimension, a WRONG_PARAMETER_TYPE error will be thrown, indicating the value is not a workbook.DataDimension or a workbook.Section.
How can developers access the dimension property of a DimensionSelector object?
Developers can access the dimension property by calling myDimensionSelector.dimension, as demonstrated in the syntax example in the article.
Source: DimensionSelector 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 SuiteScript

View all SuiteScript articles →