9

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!

  • Have you included all of your object's fields in your deployment, or just the object itself? – Alex Tennant Sep 24 '14 at 10:28
16

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.

Thanks, sridhar

Salesforce knowledge article link https://help.salesforce.com/articleView?id=000232550&type=1

  • Can you please provide a link to that Case? – Andrii Muzychuk Dec 9 '14 at 20:03
  • 3
    I also would like the link, or if you have posted to the Salesforce Community website. Its 2016 and this issue hasn't been fixed. – Renato Oliveira Feb 23 '16 at 23:22
  • Seems I still get this issue... any update on it yet? please. – Pasan Eeriyagama Jan 16 '17 at 9:17
  • But what do you do when you cannot see the object on the list, to be added to the changeset – user853710 Mar 25 '17 at 13:32
2

I had the same problem. First I deployed the custom object without the fields and hence the deployment failed. Then I came across this post, did not understand it well, but I assumed to add the custom fields of the custom object in the change set as well as the custom object and it worked.

So we need :

  1. The custom object to be added to the change set
  2. The custom fields of that custom object to be added as well to the change set.

I just don't know why salesforce are separating the custom fields from the custom object. Thans sridhar for the hint

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.