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.

Collection Delete

Deletes the objects in a collection that match the given object IDs.

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

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 deletion fails.

  • API version (string)
  • All or none (Boolean)
  • Object Ids (array)

iOS

Swift
1let request = RestClient.shared.requestForDelete(allOrNone: allOrNone, 
2    withObjects: objectIds, apiVersion: nil)
Objective-C
1- (SFRestRequest*) 
2requestForCollectionDelete:(BOOL)allOrNone 
3                 objectIds:(NSArray<NSString*>*)objectIds 
4                apiVersion:(nullable NSString *)apiVersion;

Android

Kotlin
1val request = 
2    RestRequest.getRequestForCollectionDelete(ApiVersionStrings.getVersionNumber(this), 
3        allOrNone, objectIds)
Java
1public static RestRequest getRequestForCollectionDelete(String apiVersion, 
2    boolean allOrNone, List<String> objectIds) 
3    throws UnsupportedEncodingException

React Native

1collectionDelete = <T>(
2  ids: Array<string>,
3  successCB: ExecSuccessCallback<T>,
4  errorCB: ExecErrorCallback,
5): void