DELETE_FAILED

When transferring data to Salesforce, you might encounter this error message: E2120 - ECE_SForceDataError: We got an error back from SalesForce when trying to update or insert data in SalesForce: Error returned from SFDC on delete: [message: Your attempt to delete John Doe could not be completed because it is associated with the following contracts: Demo Inc. , statusCode: DELETE_FAILED ] , Data sent: Failed to get more info on data sent to SFDC.

This error occurs when you try to delete a record that has dependencies or related records that prevent its deletion. The message may vary slightly depending on the object and its relationships, but in general, Salesforce enforces referential integrity by blocking the deletion of records that are referenced elsewhere.

Variations: 

  1. "DELETE_FAILED: This record cannot be deleted because it is associated with existing records."
  2. "DELETE_FAILED: The record you are trying to delete is referenced by another record and cannot be removed."
  3. "DELETE_FAILED: Cannot delete this record as it is related to active transactions or associated objects."

Solution:

  • If related records cannot be deleted, you may reassign them to another parent record. Edit related records and update the lookup field to point to another record. If many records are affected, use Data Loader or Workbench to mass update the related records.