Loading

Error 'Cascade deleting too many records' when you bulk delete Campaign records

Publiceringsdatum: Oct 13, 2022
Beskrivning

When a Campaign record is deleted, the child Campaign Member records are also deleted through a cascade deletion. If the Campaign Member object is set as the Master in a Master-Detail relationship to another object, the cascade deletion will carry over to that child (or detail) object too. For the Campaign and Campaign Member object relationships, these detail objects include Contacts and Leads. 

If the cascade deletion encounters too many records from Campaign Member, Contacts, Leads, or any other custom detail objects, Data Loader may return an error message: 
 
'Cascade deleting too many records: occurring when cascading to Campaign Member records'
Lösning
Warning
Always back up your data before performing any data operation. See Export Backup Data from Salesforce or Export Data for more details. It is recommended to run a test with a small subset of records to ensure the operation was successful through manually opening and verifying that the corresponding records are correct in Salesforce.


Solution 1: Lower the Data Loader batch size to 1.

The preferred solution for this is to lower batch size in Data Loader's Settings to as low as possible, preferably 1. This allows Data Loader to delete one parent record and its associated children at a time. 

 
  1. Open the Data Loader.
  2. Select Settings | Settings.
  3. Change the Batch Size to 1.
  4. Save.
  5. Try to do a Campaign Mass Delete again.


If there is a significantly high number of child records associated with the deleted parent, you may continue to receive an error when you set batch size to 1. 



Solution 2: Delete the Campaign Members first

Delete the Campaign Members from the Campaign. This avoids the need for Data Loader to cascade delete the Campaign Members and other related objects when deleting Campaigns.

 
  1. Run a Campaign report that includes the Campaign ID and Campaign Member ID, filtering the report to display only Campaign Members associated with the Campaigns to be deleted.
  2. Export the report as a CSV file.
  3. Launch Data Loader | Delete | select the Show all Salesforce objects checkbox | click on Campaign Members.
  4. Use the exported report, and map the ID to member ID.
  5. Once completed, perform the Campaign mass delete once again.



See also :
Download and Install Data Loader
 

Knowledge-artikelnummer

000382550

 
Laddar
Salesforce Help | Article