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.
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 SuiteScript
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- Set Sublist Field Values in SuiteScript 2.x for Record Management
Set sublist field values in SuiteScript 2.x for effective record management using standard and dynamic modes.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category