Understanding Sorting in Advanced Search
In SOAP web services, when you return a saved search that has sorting criteria specified in the saved search, the records are returned according to the specified sorted by order. To see the sorted by criteria that has been applied to a saved search, you can look at the saved search criteria in the UI.
When performing a search using SOAP web services, there is no way to specify the sort order of the returned results in the request itself.
In an ad-hoc SOAP web services search (a search in which sorted by criteria have not been set), you should be aware of the implicit sorted by order in which records are returned. This order is based on record type. Record types and the default sort by order for each record type are listed in the following table:
For a list of all records associated with each type, see SOAP Web Services Supported Records.
Record Type |
Default “Sorted by” Order |
---|---|
Entities |
Name (the name of the entity) |
Actvities |
Event (the title of the Event) |
Marketing |
Campaign ID
Note:
Promotion Code searches are sorted and returned by promotion code name. |
Transactions |
Date Created |
Support |
Number
Note:
Topic searches are sorted and returned by topic title. |
File Cabinet |
Name (the name of the file or folder) |
Items |
Name (the name of the item) |
Communications (includes the Note and the Message records) |
Note -sorted/returned by Author Message -sorted/returned by Message Internal ID |
Website |
Name |
Lists |
Name
Note:
Gift Certificate searches are sorted and returned by Name (From). |
Request
The SearchRequest type is used for the request. It contains the following field.
Element Name |
XSD Type |
Notes |
---|---|---|
searchRecord |
SearchRecord |
The SearchRecord type is an abstract type. An instance of a type that extends SearchRecord must be used—such as CustomerSearchBasic or EventSearchBasic. |
Response
The SearchResponse type is used for the response. It contains the following fields.
Element Name |
XSD Type |
Notes |
---|---|---|
status |
Status |
The status for this search. All applicable errors or warnings will be 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 |
pageSize |
xsd:int |
The page size for this search. |
totalPages |
xsd:int |
The total number of pages that are part of this search. |
pageIndex |
xsd:int |
The page index for the current set of results. |
searchId |
string |
Returns a specific search based on its search ID. |
recordList |
Record[] |
A list of records that meet the criteria for this search. The actual records returned need to be of a type that extends the abstract type of record. |
searchRowList |
SearchRowList |
A list of return columns that meet the criteria for this search. |
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
Related Topics
- search
- Basic Searches in SOAP Web Services
- Joined Searches in SOAP Web Services
- Advanced Searches in SOAP Web Services
- Joining Through Custom Fields
- Setting Valid Search Values
- Setting the anyof, mine, or myteam Filtering Values
- Searching by lastModifiedDate
- Search-Related Sample Code
- Searching for a Multi-select Custom Field
- Search Issues and Best Practices for SOAP Web Services and SuiteScript