Modules

filter

 

Objects/Functions

module (N/workbook)

SuiteScript 2.0

workbook.Sort

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=workbook.Sort for more information.

N/workbook Module
workbook.Sort
Object Description: A sort. A sort is used when you create a table column, a dimension sort, or a measure sort. You can create a sort using workbook.createSort(options).
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Module: N/workbook Module
Methods and Properties: Sort Object Members
Since: 2020.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=workbook.Sort

Example:

// Code Example 1
// Add additional code
//...
// Create a default Sort
var mySort = workbook.createSort({});

// Create a custom descending Sort
var mySort = workbook.createSort({
ascending: false,
caseSensitive: true,
nullsLast: true,
locale: query.SortLocale.US_EN
});

// View a workbook.Sort used in a TableDefinition
var myWorkbook = workbook.load ({
id: myWorkbookId
});

// Note that some Sort properties may be empty/null based on the loaded workbook
var mySort = myWorkbook.tableDefinitions[0].columns[0].sort;

log.audit({
title: 'Sort.ascending = ',
details: mySort.ascending
});

log.audit({
title: 'Sort.caseSensitive = ',
details: mySort.caseSensitive
});

log.audit({
title: 'Sort.locale = ',
details: mySort.locale
});

log.audit({
title: 'Sort.nullsLast = ',
details: mySort.nullsLast
});
//...
// Add additional code

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