Newer Version Available

This content describes an older version of this product. View Latest

Format and Options for Remote Objects Query Criteria

Remote Objects uses an object to specify criteria for retrieve() operations. Use this object to specify where, limit, and offset conditions for your queries.
The structured format of the query object enables Visualforce to validate the criteria at save time, reducing the likelihood of runtime errors. The format is straightforward.
The query criteria find a contact named Marc Benioff and limit the query to a single result.

where Conditions

where conditions enable you to filter the results of a retrieve operation, much the same way that a WHERE condition in a SOQL query does. The operators that are available for where conditions are:
  • eq: equals
  • lt: less than
  • gt: greater than
  • like: string matching. As with SOQL, use “%” as a wildcard character.
  • and: logical AND, used for combining conditions
  • or—logical OR, used for combining conditions
Within the where object, add field name and condition pairs to create complex criteria. Multiple conditions by default are treated as AND conditions. You can use and and or to create other criteria conditions. For example:

limit and offset Conditions

limit and offset enable you to retrieve a specific number of records at a time and to page through an extended set of results.

Use limit to specify how many records to return in one batch of results. The default value is 20. The maximum is 100.

Use offset to specify how many records to skip in the overall result set before adding records to the returned results. The minimum is 1. There is no maximum.