All Collections
Troubleshooting
Salesforce Validation Errors
Resolving Validation Errors - "Test only deployment cannot update a field from a Lookup to MasterDetail"
Resolving Validation Errors - "Test only deployment cannot update a field from a Lookup to MasterDetail"

Validation error "Test only deployment cannot update a field from a Lookup to MasterDetail" was surfaced during a Validation

Quinn Kuiper avatar
Written by Quinn Kuiper
Updated over a week ago

Explanation of the error:

This Salesforce error that Gearset is surfacing is usually encountered when running a validation for a deployment package involving a change of a field that changes from a Lookup to a MasterDetail.

This is because Salesforce does not support this change for Validations to avoid data loss or corruption.

Resolution using Compare and Deploy:

To resolve this issue try deploying the package rather than validating it first. If you wish to test out the deployment, you can first deploy into another test sandbox, as a full deployment first includes a validation of the changes as part of the deployment procedure.

Resolution when using a CI job for deployment:

If you're aiming to resolve this validation error without needing to deploy the change outside your Pipeline, try to disable validation of Pull Requests targeting the source branch - this can be a temporary adjustment of your CI job settings for the purpose of that deployment.
โ€‹


If disabling this option doesn't help with the deployment, then you'll need to consider deploying the change via a compare and deploy without validation. Unfortunately, we cannot bypass this error in any other way.
โ€‹

Further examples of this Salesforce validation error can be found here:

Disclaimer: This error is returned by Salesforce directly, rather than Gearset. Even so, we offer guidance based on our combined experience with the Metadata API. Where possible, we try to help guide you to fix or avoid this error. In the case that this isn't possible, we may need to direct you to Salesforce support for further clarification.

Did this answer your question?