deleteByExample()
Use deleteByExample() to delete big object data from your org using an sObject as a template for what to delete. All data in a big object matching the values in the sObject templates are deleted.
When deleting data, consider the following rules and guidelines:
-
Your client application must be logged in with sufficient access rights to delete individual objects within the specified object. For more information, see Factors that Affect Data Access.
-
You can’t delete records for multiple object types in one call if one of those types is related to a feature in the Setup area in Salesforce. The only exceptions are the following objects:
- Custom settings objects, which are similar to custom objects. For more information, see Create Custom Settings in Salesforce Help.
- GroupMember
- Group
- User
Deleting data involves these basic steps.
- Define an sObject using all the fields that make up the index of the big object.
- Specify the values for each field.
- Call
deleteByExample(), passing in the sObject you created. - Process the results in the
DeleteByExampleResult[]to verify whether the records have been successfully deleted.
Repeating a successful deleteByExample() operation results in success, even if the data has already been deleted.
This sample shows how to delete records in a custom big object. In this example, Account__c, Game_Platform__c, and Play_Date__c are part of the custom big object’s index. All rows where Account__c is “001d000000Ky3xIAB”, Game_Platform__c is “iOS”, and Play_Date__c is “2017-11-28T19:13:36.000z” are deleted.
This sample shows how to delete records in FieldHistoryArchive. All rows with the specified criteria are deleted.
| Name | Type | Description |
|---|---|---|
sObject | sObject[] | Array of one or more sObjects to use as templates for deletion. |