Component object method · N/query

createSort()

Component.createSort(options)

Creates a sort based on the component.

Implementation
Not started
Design
Open for proposals suggest how it should read
Proposals
A
Signature
Component.createSort(options)
Module
N/query
Returns
query.Sort
Governance
None
Script types
Client and server scripts
Version
SuiteScript 2.x, documented for 2.1; since NetSuite 2018.1
call shapefrom Oracle's parameter table
1objComponent.createSort({2    column:        /* query.Column, required */,3    ascending:     /* boolean, optional */,4    caseSensitive: /* boolean, optional */,5    locale:        /* string, optional */,6    nullsLast:     /* boolean, optional */7});
Oracle reference for this method
ParameterTypeRequiredDescription
options.columnquery.ColumnrequiredThe query result column that you want to sort by. This value sets the Sort.column property.
options.ascendingbooleanoptionalWhether the sort direction is ascending. This value sets the Sort.ascending property. The default value of this property is true , meaning that the sort direction is ascending. If you want the sort direction to be descending, set this property to false .
options.caseSensitivebooleanoptionalWhether the sort is case sensitive. This value sets the Sort.caseSensitive property. If a sort is case sensitive (and the sort direction is ascending), rows with column values that start with uppercase letters are listed before rows with column values that start with lowercase letters. If a sort is not case sensitive, uppercase and lowercase letters are treated the same. For example, the following list of items is sorted using a case-sensitive sort with a sort direction of ascending: Banana Orange apple grapefruit kiwi Here is the same list of items sorted using a regular (not case-sensitive) sort with a sort direction of ascending: apple Banana grapefruit kiwi Orange The default value of this property is false .
options.localestringoptionalThe locale to use for the sort. This value sets the Sort.locale property. A locale represents a combination of language and region, and it can affect how certain values (such as strings) are sorted. For example, languages that share the same alphabet may sort characters differently. Use this property to ensure that query results are sorted using locale-specific rules. Use the appropriate query.SortLocale enum value to pass in your argument. This enum holds all the supported values for this parameter.
options.nullsLastbooleanoptionalWhether query results with null values are listed at the end of the query results. This value sets the Sort.nullsLast property. The default value of this property is the value of the options.ascending property. For example, if the options.ascending property is set to true , the options.nullsLast property is also set to true .
B

No Mynt syntax yet.

Nothing in the language compiles to Component.createSort(options) today. How should it read?

C

Competing syntax for createSort, from GitHub Discussions. Select two or more to compare them side by side.

All discussions

Loading proposals from GitHub…

D

Write the Mynt you wish you could write.

A good proposal shows the syntax, the SuiteScript it should become, and argues for it: why it is clearer, how it fits the rest of the language, what it makes harder.

  • Clarity. Does it say what happens, without ceremony?
  • Consistency. Does it read like load, save and Ref[field]?
  • Expressiveness. Does it cover the cases people actually write?
  • Honesty. Does it hide a NetSuite cost, such as governance, that a reader should see?

N/query · Component.createSort(options)

Suggest syntax for createSort