Collection Create

Creates a collection of records of the specified object type.

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

Parameters 

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

  • API version (string)
  • All or None (Boolean)
  • Fields (array)

iOS 

Swift 

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

Objective-C 

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

Android 

Kotlin 

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

Java 

1public static RestRequest getRequestForCollectionCreate(String apiVersion,
2    boolean allOrNone, JSONArray records)

React Native 

1collectionCreate = <T>(
2  allOrNone: boolean,
3  records: Array<Record<string, unknown>>,
4  successCB: ExecSuccessCallback<T>,
5  errorCB: 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.