+ Start a Discussion
AkiTAkiT 

IDE Deploy problem: "The sharing model cannot be updated through the API currently"

I get this error constantly while trying to deploy. Where the issue may be?

Best Answer chosen by Admin (Salesforce Developers) 
aalbertaalbert
My guess is you are deploying a custom object that already exists in the destination org and the sharing model is different between the destination org and the source org.

For example, I have a custom object "test__c" in my destination org (where I want to deploy to). And the sharing model is set to "ReadWrite". If I set the sharing model to "Private" in my source org and deploy to the destionation org, I will receive the same error you are seeing.

And from the error message, this functionality is not supported in the metadata api yet.

All Answers

aalbertaalbert
My guess is you are deploying a custom object that already exists in the destination org and the sharing model is different between the destination org and the source org.

For example, I have a custom object "test__c" in my destination org (where I want to deploy to). And the sharing model is set to "ReadWrite". If I set the sharing model to "Private" in my source org and deploy to the destionation org, I will receive the same error you are seeing.

And from the error message, this functionality is not supported in the metadata api yet.
This was selected as the best answer
AkiTAkiT
That may well be. Have to try out.
Thanks!
JonPJonP
AT,

This error may also occur if you are trying to add a master/detail lookup custom field to an existing custom object, via the deploy wizard.  Adding a master/detail relationship to an existing object requires changing the child object's sharing model, because going forward its sharing rules will be inherited from the parent object.  But because you cannot update an object's sharing model via the Metadata API / IDE deploy, the server will reject this change.

The workaround in this case is to add the master/detail lookup field to your target organization manually, and then deploy the rest of your changes via the Metadata API / Force.com IDE.

Jon
salesforce.com Product Manager
AkiTAkiT
Thanks for your suggestions. I was able to solve.
I think the Metadata API has in the latest IDE release brought some features that may easily confuse you / overload the eclipse. Hope you keep up the good work and also try to make all error messages as clear as possible.

I also got error "Syntax error: missing ')' " or similar for my custom object and was really trying to delete any possible field/validation/button that may have caused it - just to notice it was one validation rule for some reason (!!) causing the error. I didn't notice also that after deleting manually via UI you need to refresh the custom object unless you will keep getting error - I thought there is sync check before deploying? But all in all this confusion came with the meta API and not very clear error...
Mehmet_ErgunMehmet_Ergun

I get the same message too when trying to change a master detail to a lookup via the API.  You have to deploy the change manually.

joeliojoelio

Has this been fixed yet, 3 years later ran into same symptom when changed a relationship from lookup to masterdetail.

 

Any workarounds that can be done in coding, having people manually do this is a huge pain and pitfall to dev process.

 

thanks

Joel

 

TechnossusTechnossus

I was facing the same pbm  by your post its got solved thanks

 

Cheers

Raman

ForceDeveloper.orgForceDeveloper.org
I hit this error today. For me, I was deploying updates from a sandbox to production on an object that already existed in production. I had inadvertently included the object itself in my change set. Once I cloned my change set and removed the custom object and re-deployed, it passed validation and deployment. Hopefully this helps someone experiencing the same.