Search.save()
The content in this help topic pertains to SuiteScript 2.0.
Method Description |
Saves a search created by search.create(options) or loaded with search.load(options). Returns the internal ID of the saved search. You must set the title and id properties for a new saved search before you save it, either when you create it with search.create(options) or by setting the Search.title and Search.id properties. If you do not set the saved search ID, NetSuite generates one for you. See Search.id.
Note:
You do not need to set these properties if you load a previously saved search with search.load(options) and then save it. This method also includes a promise version, Search.save.promise(). For more information about promises, see Promise Object. |
Returns |
the internal search ID of the saved search as a number |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
5 units |
Module |
|
Since |
2015.2 |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
A search has already been saved with that name. Please use a different name. |
The Search.title property on search.Search is not unique. |
|
Saved search script IDs must be unique. Please choose another script ID. If you are trying to modify an existing saved search, use search.load(). |
The Search.id property on search.Search is not unique. |
|
{1}: Missing a required argument: {2} |
Required Search.title property not set on search.Search. |
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
...
mySalesOrderSearch.save();
...
//Add additional code