Print this page

How to enable cascade delete on custom lookup relationships

Knowledge Article Number 000199350
Description I want to know how can I delete a record from an object (Standard or Custom) and all records within another object that is related via a Lookup Relationship.
Resolution WARNING:

  A cascade-delete bypasses security and sharing settings, which means users can delete records when the target lookup record is deleted even if they don’t have access to the records. To prevent records from being accidentally deleted, cascade-delete is disabled by default. Contact Salesforce.com to get the "Enables cascade delete on custom lookup relationships" feature enabled for your organization.


  Cascade-delete and its related options are not available for lookup relationships to business hours, community, lead, price book, product, or user objects.

  In a chain of lookup relationships, these behaviors work independently on each target field at each level. Say, for example, field A is the target lookup of field B, which in turn is the target lookup of field C. You can have a delete restriction on A and none on B, which means that A can’t be deleted but B can. Once B is deleted, the relationship between A and B no longer exists and C will hold an empty value for the lookup.

  In a multilevel lookup relationship, these options might conflict. For example, in the scenario where field A is the target lookup of field B, which in turn is the target lookup of field C, you might specify that A can delete B, but B cannot be deleted because it’s in a relationship with C. If you try to delete A, you’ll get an error saying that B can’t be deleted because it’s linked to C.

  If the parent record in a lookup relationship is deleted, the field history tracking for the child record does not record the deletion. For example, if a parent account is deleted, the Account History related list for the child account does not show the deletion.

  In order to facilitate this request, please provide Salesforce Support with the following:

1. What is Organization ID of the production or sandbox?  (Navigate to Setup > Company Profile > Company Information)(Please provide the specific 15 or 18 character org id):
 
2. Are you the system administrator authorized on behalf of this organization to request this feature?:

3: I understand that the cascading deletion functionality bypasses security and sharing settings, which means users can delete records when the target lookup record is deleted even if they don’t have access to the records (YES/NO):



 




promote demote