ANS-0078 · SAVED SEARCHES & FORMULAS

How to Manage Sorting Order in NetSuite Scripted Saved Searches?

New sort columns in NetSuite scripted saved searches are appended after existing UI-defined ones, not overriding them, which may necessitate custom sorting functions.

Short answer

New sort columns added to NetSuite scripted saved searches are appended after existing UI-defined sort columns and do not override them. For complex sorting needs beyond standard additions, a custom sorting function may be required to achieve the desired record order.

Scenario

Users often seek to implement precise or custom sorting logic within NetSuite scripted saved searches. The challenge arises from the system's default behavior, where newly added sort columns interact with existing UI-defined sorting, potentially leading to unexpected record order.

Solution

When implementing sorting in a NetSuite scripted saved search, it is crucial to understand the system's behavior regarding sort column application. New sort columns are always added *after* any existing sorting columns that have been defined through the user interface. This means that new sort columns do not override previously established UI sorting. For situations requiring highly specific or complex sorting logic that cannot be achieved by simply adding new columns, the most robust approach is to build a custom sorting function to manage the record order.

Expert NetSuite Support

Need help with this NetSuite issue?

Saved Searches & Formulas consulting and configuration support

Talk to a consultant