[SalesForce] Deployment Validations Changing Master-Detail to Lookup (or vice versa)

I came across the below notes in one of the Salesforce guides around deployments.

From the below statement, i could not understand, if Salesforce is trying to say that we cannot run validations, when our package involves a change of changing the field type from Master-detail to LOOKUP or vice versa.

Note
If you change a field type from Master-Detail to Lookup or vice versa, the change isn’t supported when using the Validate option to test a deployment. This change isn’t supported for test deployments to avoid data loss or corruption. If a change that isn’t supported for test deployments is included in the deployment package, the test deployment fails and issues an error.

If your deployment package changes a field type from Master-Detail to Lookup or vice versa, you can still validate the changes before you deploy to production. Perform a full deployment to another test sandbox. A full deployment includes a validation of the changes as part of the deployment process.

What is meant by the emphasized sections above?

  • …from Master-Detail to Lookup or vice versa, the change isn’t supported when using the Validate option to test a deployment…
  • …Perform a full deployment to another test sandbox. A full deployment includes a validation…

Best Answer

When you come across something like this is is useful to link to the source in addition to providing a screenshot. I assume you are referencing Validate a Change Set

If you change a field type from Master-Detail to Lookup or vice versa, the change isn’t supported when using the Validate option to test a deployment. This change isn’t supported for test deployments to avoid data loss or corruption. If a change that isn’t supported for test deployments is included in the deployment package, the test deployment fails and issues an error.

If your deployment package changes a field type from Master-Detail to Lookup or vice versa, you can still validate the changes before you deploy to production. Perform a full deployment to another test sandbox. A full deployment includes a validation of the changes as part of the deployment process.

They are saying that you can not perform a validation of a change set if that change set includes a field type change between Master-Detail and Lookup.

It appears that the underlying process that validates the change set could result in data loss or corruption if it is performed in this case. Rather than risk that Salesforce have opted to block the validation.

If you still need to validate the change set you could create a new sandbox that closely resembles the target org. Then do a full deployment in that sandbox to see the results. That full deployment will include a validation of the change set.

Related Topic