Modules

filter

 

Objects/Functions

module (N/workbook)

SuiteScript 2.0

workbook.createSortDefinition(options)

{workbook}.createSortDefinition({selector: {workbook.AllSubNodesSelector | workbook.DimensionSelector | workbook.PathSelector*},sortBys: {Array*}})

N/workbook Module
workbook.createSortDefinition()
Method Description: Creates a sort definition. A sort definition is used to specify sorting for a category, legend, pivot definition, or pivot axis.
Returns: workbook.SortDefinition
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/workbook Module
Sibling Module Members: N/workbook Module Members
Since: 2020.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=workbook.createSortDefinition(options)

Example:

// Code Example 1
// Add additional code
//...
// Create an AllSubNodesSelector SortDefinition sorted by Measure
var mySort = workbook.createSortDefinition({
selector: workbook.createAllSubNodesSelector(),
sortBys: [myMeasureSort]
});

// Create a DimensionSelector SortDefinition sorted by Measure
var mySort = workbook.createSortDefinition({
selector: myDimensionSelector,
sortBys: [myMeasureSort]
});

// Create a PathSelector SortDefinition sorted by Dimension
var mySort = workbook.createSortDefinition({
selector: myPathSelector,
sortBys: [myDimensionSort]
});
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_159051836190.html