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
A
suitescript api
1objComponent.createSort({2 column: /* query.Column, required */,3 ascending: /* boolean, optional */,4 caseSensitive: /* boolean, optional */,5 locale: /* string, optional */,6 nullsLast: /* boolean, optional */7});
| Parameter | Type | Required | Description |
|---|---|---|---|
| options.column | query.Column | required | The query result column that you want to sort by. This value sets the Sort.column property. |
| options.ascending | boolean | optional | Whether 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.caseSensitive | boolean | optional | Whether 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.locale | string | optional | The 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.nullsLast | boolean | optional | Whether 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
mynt syntax
No Mynt syntax yet.
Nothing in the language compiles to Component.createSort(options) today. How should it read?
C
community proposals
Competing syntax for createSort, from GitHub Discussions. Select two or more to compare them side by side.
Loading proposals from GitHub…
D
suggest an alternative
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,saveandRef[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?