getSavedSearch
This operation allows users to retrieve a list of existing saved search IDs on a per-record-type basis (for example, all saved search IDs for every Customer saved search). Note that after you retrieve the list of saved search IDs, you may need to look in the NetSuite UI to see the criteria defined for the saved search. To navigate to the list of saved searches in the NetSuite UI, go to Lists > Search > Saved Searches.
This API takes a search record type as a request argument and returns a list of record references of the saved search. For each saved search, the response includes the internalId, scriptId, and name.
For use cases explaining why you would want to get a list of saved search IDs and then reference a specific ID in your code, see Reference Existing Saved Searches.
There is no async equivalent for this operation.
Request
The GetSavedSearchRequest type is used for the request. It contains the following fields.
Element Name |
XSD Type |
Notes |
---|---|---|
record |
GetSavedSearchRecord |
|
Response
The GetSavedSearchResponse type is used for the response. It contains the following fields.
Element Name |
XSD Type |
Notes |
---|---|---|
status |
Status |
The status for this operation. All applicable errors or warnings are listed within this type. |
totalRecords |
xsd:int |
The total number of records for this search. Depending on the pageSize value, some or all the records may be returned in this response |
recordRefList |
Record[] |
A list of records that correspond to the specified ids. The actual records returned need to be of a type that extends the abstract type Record. |
Faults
This operation can throw one of the following faults. See SOAP Fault Status Codes for more information on faults.
-
InvalidSessionFault
-
InvalidCredentialsFault
-
ExceededRequestLimitFault
-
ExceededUsageLimitFault
-
ExceededRecordCountFault
-
ExceededRequestSizeFault
-
UnexpectedErrorFault
Sample Code
C#
GetSavedSearchRecord record = new GetSavedSearchRecord();
record.searchTypeSpecified = true;
record.searchType = SearchRecordType.transaction;
_service.getSavedSearch(record);
;
Java
public void getSavedSearches() throws RemoteException{
this.login(true);
GetSavedSearchRecord record = new GetSavedSearchRecord();
record.setSearchType(SearchRecordType.transaction);
GetSavedSearchResult result = _port.getSavedSearch(record);
}
SOAP Request
<soap:Body>
<getSavedSearch xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<record searchType="transaction"/>
</getSavedSearch>
</soap:Body>
SOAP Response
<soapenv:Body>
<getSavedSearchResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<platformCore:getSavedSearchResult xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com">
<platformCore:status isSuccess="true"/>
<platformCore:totalRecords>5</platformCore:totalRecords>
<platformCore:recordRefList>
<platformCore:recordRef xsi:type="platformCore:CustomizationRef" internalId="26" scriptId="customsearch26">
<platformCore:name>Custom Transaction Search</platformCore:name>
</platformCore:recordRef>
<platformCore:recordRef xsi:type="platformCore:CustomizationRef" internalId="27" scriptId="customsearch27">
<platformCore:name>CC Transaction Search</platformCore:name>
</platformCore:recordRef>
<platformCore:recordRef xsi:type="platformCore:CustomizationRef" internalId="42" scriptId="customsearch42">
<platformCore:name>Returned Items</platformCore:name>
</platformCore:recordRef>
<platformCore:recordRef xsi:type="platformCore:CustomizationRef" internalId="44" scriptId="customsearch44">
<platformCore:name>Ordered More than One Item</platformCore:name>
</platformCore:recordRef>
<platformCore:recordRef xsi:type="platformCore:CustomizationRef" internalId="46" scriptId="customsearch46">
<platformCore:name>Spending Account Average</platformCore:name>
</platformCore:recordRef>
</platformCore:recordRefList>
</platformCore:getSavedSearchResult>
</getSavedSearchResponse>
</soapenv:Body>