Skip to main content
All CollectionsTroubleshootingSalesforce validation errors
Resolving validation errors - "Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail relationship field"
Resolving validation errors - "Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail relationship field"

Error "Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail relationship field" surfaced during Validation

Dario Messina avatar
Written by Dario Messina
Updated over 10 months ago

Explanation of the error:

This Salesforce error that Gearset is surfacing is usually encountered when trying to deploy an update to an object related with Master-Detail relationship to another object.

Let's say you have two objects ObjectA and ObjectB and they are related with Master-Detail relationship. ObjectA is the master and ObjectB is the child.
If you only deploy ObjectB, you might see the above error.

Resolution:

To resolve this issue try adding the master-detail lookup field (even if it has not been changed) to your deployment and the error will not occur anymore.

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?