Special Nested Search Properties in NetSuite
This article explains Special Nested Search Properties in NetSuite and how to effectively use them for optimal search performance.
Special Nested Search Properties
Nested Searches
You can use results from one search in the filters of another search. The nested search runs first and returns an array of internal IDs, then the outer search uses those IDs in its filter.
Important:
If you nest searches the wrong way, it can cause performance issues.
Special Nested Search Properties
The all and default properties are a couple of special search options you'll use often. By default, config searches return up to 1000 results. If you set all: true, you can get more than 1000, but it might slow things down. If there are no results results, config returns an empty array, which might cause errors. The default property gives you a fallback value instead.
The example below shows a second search inside another. The second search is on the record customrecord_nxc_cr and returns a map of custrecord_nxc_cr_asset. This field stores the asset and therefore returns the internal ID of the asset found on the record. It uses a default of 0 to avoid issues if there are no results found in the nested search. Any results found are an array of assets internal IDs, and get excluded from the main search because the nested search is inside of this filter: ["internalid","noneof",
1"record": "customrecord_nx_asset",2 "filters": [3 ["internalid","anyof","${event.caseassets}"],"and",4 ["internalid","noneof",{5 "array": true,6 "default": "0",7 "assets": {8 "record": "customrecord_nxc_cr",9 "filters": [10 ["custrecord_nxc_cr_case","anyof","${event.supportcase}"],"and",11 ["custrecord_nxc_cr_task","noneof","${event.internalid}"]12 ],13 "map": "custrecord_nxc_cr_asset"14 }15 }]16 ],Frequently Asked Questions (4)
How can I use results from one search as filters in another search in NetSuite?
What are the potential performance issues with improperly nested searches?
How can I retrieve more than 1000 results in a nested search, and what are the consequences?
What happens if there are no results in a nested search and how can I handle this scenario?
Was this article helpful?
More in Searches
- Creating Searches with SuiteScript in NetSuite
Create and manage searches in NetSuite with SuiteScript, utilizing filters, columns, and settings effectively.
- Error Handling in Searches with SuiteScript 2.0 Features
Gain insights into error handling in SuiteScript searches, including codes and common issues that arise when loading saved searches.
- Search for Sublist Line Fields With Dynamic Tables in NetSuite
Learn how to optimize search queries for sublist line fields in NetSuite using dynamic tables and SuiteQL.
- PagedData Object Members in NetSuite SuiteScript 2.0
PagedData provides efficient pagination for search results in SuiteScript, enabling effective handling of large data sets.
Advertising
Reach Searches Professionals
Put your product in front of NetSuite experts who work with Searches every day.
Sponsor This Category