Collection Update

Updates the requested collection with the given records.

Parameters 

For collections, you can disallow partial updates by specifying an all-or-none parameter. When you set this parameter to true, Mobile SDK rolls back the entire request if any record update fails.

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

  • API version (string, optional)
  • “All or none” preference (Boolean)
  • Records (array of sObjects)

iOS 

Swift 

1let request = RestClient.shared.requestForCollectionUpdate(allOrNone,
2    records:records, apiVersion: apiVersion)

Objective-C 

1- (SFRestRequest*) requestForCollectionUpdate:(BOOL)allOrNone
2                                      records:(NSArray<NSDictionary*>*)records
3                                    apiVersion:(nullable NSString *)apiVersion;

Android 

Kotlin 

1val request =
2    RestRequest.getRequestForCollectionUpdate(ApiVersionStrings.getVersionNumber(this),
3        allOrNone, records)

Java 

1public static RestRequest getRequestForCollectionUpdate(String apiVersion,
2    boolean allOrNone, JSONArray records) throws JSONException

React Native 

1collectionUpdate= <T>(
2allOrNone: boolean,
3records: Array<Record<string, unknown>>,
4successCB: ExecSuccessCallback<T>,
5errorCB: ExecErrorCallback,
6): void

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.