Search Object Syntax in SuiteScript for NetSuite
Search Object in SuiteScript enables creating, running, and saving NetSuite searches through various methods.
The Search Object in SuiteScript encapsulates a NetSuite search and allows developers to create, run, and save searches efficiently. This functionality is valuable for managing data and automating workflows in NetSuite. Notably, searches do not need to be saved to be executed, providing flexibility in how data is retrieved and used.
Supported Script Types
The Search Object can be utilized within both client and server scripts. When working on SuiteScript projects, developers should be familiar with SuiteScript 2.x Script Types to maximize the potential of this feature.
Module
The relevant module for the Search Object is the N/search Module, which provides the necessary functions and properties.
Methods and Properties
To explore the methods and properties available with the Search Object, refer to the Search Object Members.
Syntax
The following code snippet demonstrates the syntax for loading a saved search in SuiteScript:
var mySearch = search.load({ id: 'customsearch_my_so_search'});This snippet is a simplified example; for a complete understanding, developers are encouraged to look into further N/search Module Script Samples.
Important Note
While the snippet illustrates how to load a search, it is crucial to develop a complete script according to specific needs. For exploring additional methods and using the Search Object effectively, consulting the N/search Module documentation is recommended.
Who This Affects
- Developers working with SuiteScript 2.0 and 2.1.
- Administrators managing search operations within NetSuite.
Key points to consider when using the Search Object include its support for various script types and the importance of understanding the methods available for effective data management.
Frequently Asked Questions (4)
Can the Search Object be used in both client and server scripts in SuiteScript?
Is it necessary to save a search in NetSuite before executing it using the Search Object?
Which module should I use when working with Search Objects in SuiteScript?
Is the syntax for loading a saved search in SuiteScript different in SuiteScript 2.0 and 2.1?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Custom Tool Script Enhancements in NetSuite
Custom tool scripts in NetSuite gain execution log support and a new management page in February 16, 2026.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
