ANS-0178 · SAVED SEARCHES & FORMULAS
How to Use the ‘noneof’ Search Operator with List/Record Fields in NetSuite SuiteScript 2.x?
Understand how to correctly apply the 'noneof' operator in NetSuite SuiteScript 2.x searches by referencing the internal IDs of list or record field members.
Short answer
To effectively use the 'noneof' search operator on list/record fields in NetSuite SuiteScript 2.x, always specify the internal ID of the list members you wish to exclude. This ensures accurate filtering, preventing unintended results when filtering by specific statuses or categories.
Scenario
Users attempting to filter search results in NetSuite SuiteScript 2.x using the 'noneof' operator on a list/record field may find that the filter does not behave as expected. This often occurs when the filter is configured with the display name or an incorrect value instead of the required internal ID for the list item.
Solution
The filter functions correctly when the internal ID of the list item is used for the 'noneof' operator. For instance, if a list item like 'Task Completed' has an internal ID of '2', the following SuiteScript 2.x filter syntax will successfully exclude records with that status:
search.createFilter({ name: 'custrecord_requeststatus', operator: search.Operator.NONEOF, values: ['2'] });When utilizing the 'noneof' (and likely 'anyof') search operator for list/record fields, it is essential to use the internal ID of the list members to be excluded.
Expert NetSuite Support
Need help with this NetSuite issue?
Saved Searches & Formulas consulting and configuration support
