SortDefinition Object Members
Explore SortDefinition object members in SuiteScript, including key properties like selector and sortBys for workbook functionality.
TL;DR
The SortDefinition object in SuiteScript provides essential properties for defining sorting criteria in workbooks, including selector and sortBys. Understanding these members is vital for effectively leveraging sorting within pivot axes.
What is the SortDefinition Object?
The SortDefinition object is used to create sorting dimensions within workbooks, enhancing data manipulation and presentation. It allows you to define how data is sorted when creating pivot axes through methods such as workbook.createSortDefinition(options).
SortDefinition Object Members
Properties
The following properties are part of the SortDefinition object:
| Property Name | Type | Description |
|---|---|---|
SortDefinition.selector | workbook.DimensionSelector, workbook.PathSelector | The selector that determines the criterion for sorting. |
SortDefinition.sortBys | Array of workbook.SortByDataDimensionItem, workbook.SortByMeasure | Defines the sorting order. |
Supported Script Types
The SortDefinition object is specifically designed to be used within server scripts.
Example Usage
Here's how to create an instance of the SortDefinition object in your SuiteScript:
1// Add additional code2...3var mySortDefinition = workbook.createSortDefinition({4 selector: myDimensionSelector,5 sortBys: [myDimensionSort]6});7...8// Add additional codeThis example illustrates how to define your sorting criteria effectively using the SortDefinition object, which can then be utilized in methods that require sorting parameters, such as when creating a pivot axis.
Who This Affects
- Developers: Those implementing workbooks in SuiteScript will directly benefit from understanding the SortDefinition members.
- Administrators: Users managing reports and dashboards can leverage sorting functionalities to enhance data visibility.
Key Takeaways
- The SortDefinition object includes essential properties for sorting in workbooks.
selectorandsortBysare vital for customizing sorting behavior.- This object is used within server scripts, enhancing the flexibility of data manipulations in NetSuite.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
What types of selectors can be used with the SortDefinition object in SuiteScript?
Is the SortDefinition object applicable to all types of scripts within NetSuite?
How do you define sorting order using the SortDefinition object?
Can the SortDefinition object be used for enhancing data visibility in dashboards?
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