Skip to main content

Posts

Showing posts from 2015

Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail relationship field

 Scenario:We have created a new object which has a Master-detail relationship with Account. When deploying a new object to the target organization, The deployment fails with the error message "Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail relationship field"   Solution: What we did wrong: When creating change set, We have added the object , but did not add the Master-detail relationship field. What's is happening in background: Every object has a field "Sharing Model" which denotes the organization-wide-default of the object. When we create a Master detail relationship in any object, The Sharing Model field is automatically set to "ControlledByParent" which means that the access to the records' of the object is determined by the access to the parent's record. So when you add this object alone in the change set without adding the Master-detail relationship and try to deploy the object, It is reason