Using Search Specifications

You can use the searchspec argument of QueryPage to return only those records matching specified search criteria for an object. You can also specify the sort order and sort sequence for returned records using the sortorder and sortsequence arguments respectively. For more information, see Specifying the Sort Order and Sort Sequence.

The searchspec argument is specified as an attribute of an Object element in requests, for example:

<Contact searchspec= "[ContactFirstName] =  'Jo* ' ">

which would return only contact records for which the ContactFirstName field value begins with Jo. The search specification can be set on any field type. The query syntax is described in QueryPage Arguments.

Tip: It is recommended to use a stateful rather than a stateless QueryPage Web service request, if it is required to paginate through a snapshot of data. However, if you do use a stateless request, it is recommended to use sort criteria to reduce the possibility of returning the same record when paging through results using the QueryPage method. For more information, see Use Sort Criteria when Using QueryPage.