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 

We've Moved

Welcome to the new home of the Mobile SDK Developer Guide! For now, the Japanese guide can be found in PDF form.