search.load(options)
Method Description |
Loads an existing saved search and returns it as a search.Search. The saved search could have been created using the UI or created with search.create(options) and Search.save(). The search.load(options) method also includes a promise version, search.load.promise(options). For more information about promises, see Promise Object. |
Returns |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
5 units |
Module |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required |
Internal ID or script ID of a saved search. The script ID starts with |
2015.2 |
|
string |
Required if the saved search to load uses a standalone search type, optional otherwise |
The search type of the saved search to load. Use a value from the search.Type enum for this parameter. This parameter is required if the saved search to load uses a standalone search type. A standalone search type is a search type that does not have a corresponding record type. Typically, the search type of the saved search can be determined automatically based on the corresponding record type. In this case, this parameter is not required. For standalone search types, you must specify the search type explicitly using this parameter. The following is a list of standalone search types:
|
2015.2 |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
That search or mass update does not exist. |
Cannot find saved search with the saved search ID from |
|
{1}: Missing a required argument: {2} |
Required parameter is missing. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/search Module Script Samples.
//Add additional code
...
var mySearch = search.load({
id: 'customsearch_my_so_search'
});
...
//Add additional code