Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

SOQL Query

Executes the given SOQL query and returns the requested fields of records that satisfy the query.

The batchSize parameter can range from 200 to 2,000 (default value) and is not guaranteed to be the actual size at runtime. By default, returns up to 2,000 records at once. If you specify a batch size, this request returns records in batches up to that size. Specifying a batch size does not guarantee that the returned batch is the requested size.

Parameters

  • API version (string, optional)
  • Query (string)
  • Batch size (integer)

iOS

Swift
1RestClient.shared.request(forQuery:apiVersion:batchSize:)
Objective-C
1- (SFRestRequest *)requestForQuery:(NSString *)soql 
2                        apiVersion:(nullable NSString *)apiVersion
3                         batchSize:(NSInteger)batchSize;

Android

Kotlin
1@Throws(UnsupportedEncodingException::class)
2fun getRequestForQuery(apiVersion: String?, q: String?): RestRequest
Java
1public static RestRequest 
2    getRequestForQuery(String apiVersion, String q) 
3    throws UnsupportedEncodingException
4
5public static RestRequest 
6    getRequestForQuery(String apiVersion, String q, int batchSize) 
7    throws UnsupportedEncodingException