This sample shows how to delete records, in bulk, that match common criteria.
See How to run samples for information about how to run this sample.
The BulkDeleteRequest
message is intended to be used in a scenario where it contains data that is needed to create the bulk delete request.
In order to simulate the scenario described in What this sample does, the sample will do the following:
- Checks for the current version of the org.
- Creates an sample account record.
- Queries for a system user to send an email to after the bulk delete operation completes.
- The
BulkDeleteRequest
creates the bulk delete process and set the request properties. - The
InspectBulkDeleteOperation
method inspects and display the information about the createdBulkDeleteOperation
. - The
RetrieveBulkDeleteOperation
method retrieves theBulkDeleteOperation
.
- Checks whether the standard email templates are present.
- The
PerformBulkDelete
method performs the main ulk delete operation.
Display an option to delete the sample data that is created in Setup. The deletion is optional in case you want to examine the entities and data created by the sample. You can manually delete the records to achieve the same result.