Collection Retrieve

Retrieves a collection of objects of the given object type that match the given object IDs.

Mobile SDK provides a custom response object for parsing Collection request results. See Collection Response.

Parameters

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

  • API version (string, optional)
  • Object type (string)
  • Object IDs (array)
  • Field list (array)

iOS

Swift
1let request = RestClient.shared.requestForRetrieve(withObjectType: objectType, 
2    objectIds: objectIds!, fieldList: fieldList!, apiVersion: nil)
Objective-C
1- (SFRestRequest*) requestForCollectionRetrieve:(NSString*)objectType 
2                                      objectIds:(NSArray<NSString*>*)objectIds 
3                                      fieldList:(NSArray<NSString*>*)fieldList 
4                                     apiVersion:(nullable NSString *)apiVersion;

Android

Kotlin
1val request = 
2    RestRequest.getRequestForCollectionRetrieve(ApiVersionStrings.getVersionNumber(this), 
3        objectType, objectIds, fieldList)
Java
1RestRequest getRequestForCollectionRetrieve(String apiVersion, String objectType, 
2    List<String> objectIds, List<String> fieldList)

React Native

1collectionRetrieve = <T>(
2  objectType: string,
3  ids: Array<string>,
4  fields: Array<string>,
5  successCB: ExecSuccessCallback<T>,
6  errorCB: ExecErrorCallback,
7): void