2

I am getting the following error when deploying from one of the sandbox.

All Component Failures:
1. objects/Contact.object -- Error: Read is not a valid sharing model for Contact when Account sharing model is Private
2. objects/Case.object -- Error: ReadWriteTransfer is not a valid sharing model for Case when Account sharing model is Private
3. objects/Opportunity.object -- Error: Read is not a valid sharing model for Opportunity when Account sharing model is Private

*********** DEPLOYMENT FAILED ***********

1
  • Do you know how to edit the actual metadata files themselves? If so, just remove the sharing model lines from those files. You have an inconsistency in your sharing models between the source org and the target org. Feb 11, 2016 at 19:36

1 Answer 1

2

These objects have master-detail relations. As such they (the "detail" objects) inherit their sharing from the master. What you've tried to do is say that Accounts are private, but Contacts are Read(able). This is not permitted under Salesforce sharing rules:

https://help.salesforce.com/HTViewHelpDoc?id=overview_of_custom_object_relationships.htm

You don't say how you're deploying, so I'll assume Eclipse or ant.

The simplest way to get deployable metadata is to make the changes in your sandbox and pull all the metadata. Don't try and hand edit files.

In this case you'll set Account model to "Read" and Contact sharing model will change accordingly. THen when you pull the metadata for both Account.object and Contact.object they'll be in agreement. Same applies for your other errors.

2
  • Couldn't this be due to mismatch in the OWD of account in the target and the source orgs too? Thanks
    – Prajith
    Feb 11, 2016 at 17:52
  • @Stygon, yes if your target org has different OWD rules and you're not explicitly deploying those rules from the old org, then the deploy can fail.
    – powlo
    Feb 12, 2016 at 12:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .