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

I am trying to deploy an update to a custom object. The object and classes associated with it work perfectly in my sandbox, but when I try to deploy, I get the following error:

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

The object has two fields of Master-Detail type, one is Contact, which I left default sharing and one is another custom object which I set to Read Only.

On the object itself I unchecked sharing in the hope that would help.

Does anyone have any idea what I can do here?

Thank you!

Answer

This is a recent issue with Salesforce. To workaround this issue, please add the master detail field (even if it has not been changed) to your deployment and the error will go away.

I have already filed a Case with Salesforce and they are working on it.

Salesforce knowledge article link

Attribution
Source : Link , Question Author : hgolov , Answer Author : Jarvis

Leave a Comment