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