SortDefinition Object Members

Explore SortDefinition object members in SuiteScript, including key properties like selector and sortBys for workbook functionality.

·2 min read·View Oracle Docs

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 NameTypeDescription
SortDefinition.selectorworkbook.DimensionSelector, workbook.PathSelectorThe selector that determines the criterion for sorting.
SortDefinition.sortBysArray of workbook.SortByDataDimensionItem, workbook.SortByMeasureDefines 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:

suitescript
1// Add additional code
2...
3var mySortDefinition = workbook.createSortDefinition({
4 selector: myDimensionSelector,
5 sortBys: [myDimensionSort]
6});
7...
8// Add additional code

This 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.
  • selector and sortBys are 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?
The SortDefinition object allows the use of `workbook.DimensionSelector` and `workbook.PathSelector` as selectors, which determine the criteria for sorting.
Is the SortDefinition object applicable to all types of scripts within NetSuite?
No, the SortDefinition object is specifically designed for use within server scripts.
How do you define sorting order using the SortDefinition object?
Sorting order is defined using the `sortBys` property, which is an array of `workbook.SortByDataDimensionItem` and `workbook.SortByMeasure`.
Can the SortDefinition object be used for enhancing data visibility in dashboards?
Yes, administrators can leverage the SortDefinition object to enhance data visibility in reports and dashboards by customizing sorting behaviors.
Source: SortDefinition 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 →