0

Salesforce has the option to enable cascade deletion for lookup relationships. Thus, if you delete the parent in the lookup, the child will also be deleted. However, this option must be enabled on a per-organization basis.

If I enable this option in an unmanaged package (so the option is enabled on that org), will the lookup still be cascade delete on any orgs that install the package (Even if that org has not specifically asked Salesforce to enable it)?

If not, what will happen? Will the lookup be converted to "clear field when parent object is deleted", or will an error occur when I attempt to install the package?

0

Just because you had Cascade Delete enabled in the Org where your Unmanaged Package was created will not somehow transfer this setting to an Org where your Unmanaged Package is installed. If that happened it would be a disaster for the destination Org. There is no place in the Unmanaged Package metadata to store this setting and transfer it anyway. If you want your Unmanaged Objects to behave this way after Package Install I would use Master-Detail relationships. HOWEVER I have not actually tried this and as we all know sometimes Salesforce does surprising things.

| improve this answer | |
0

I still don't have the resources to check with unmanaged packages.

However, using change sets you can move a cascade-delete lookup field from an org that has the option enabled to an org that does not.

The transferred field will maintain its cascade-delete status, and the recipient org will not have the option enabled. If the field is later changed from being cascade-delete, the option cannot be re-enabled without using a change set again.

NB: Third-party tools might choke on this operation. At the very least, ClickDeploy.io will not allow the change to happen, giving an error telling you to enable the option on the recipient org first.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.