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.

Retrieve

Retrieves a single sObject record by object ID.

If you provide a list of fields, Mobile SDK retrieves only those fields. Otherwise, it returns all accessible standard and custom fields.

Parameters

  • API version (string, optional)
  • Object type (string)
  • Object ID (string)
  • Field list (list of strings, optional)

iOS

In iOS, the fieldList parameter expects a comma-separated list of field names, or nil.

Swift
1RestClient.shared.requestForRetrieve(withObjectType:objectId:fieldList:apiVersion:)
Objective-C
1- (SFRestRequest *)requestForRetrieveWithObjectType:(NSString *)objectType
2	                                    objectId:(NSString *)objectId 
3	                                   fieldList:(nullable NSString *)fieldList 
4                                         apiVersion:(nullable NSString *)apiVersion;

Android

Kotlin
1fun getRequestForRetrieve(apiVersion: String?, objectType: String?, 
2objectId: String?, fieldList: List<String>?): RestRequest
Java
1public static RestRequest getRequestForRetrieve(String apiVersion, String objectType, String objectId, List<String> fieldList) throws UnsupportedEncodingException

See Also