function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dylan EgnoskeDylan Egnoske 

ReadWrite is not a valid sharing model for Contact when Account sharing model is Private

Hello,
I am working with on packaging up an org with unlocked packages. I have a base package with Account and Contact. Account's OWD is set to private and Contact is set to Controlled by Parent. When I try to push my source code to a scratch org I get the following error: "ReadWrite is not a valid sharing model for Contact when Account sharing model is Private." Does anyone know if there is a work around for this?
Sainath VenkatSainath Venkat
@Dylan Egnoske,

Since Contact is set to controlled by parent and account is private, you can't simply have a code which will read write(maybe contact creation method might be there in your code).

Can you try using " without sharing" key in your source code once, it should be something like below
public without sharing classname{}

In this context also, user should have modify all data permission
Jenna Kowalczyk 1Jenna Kowalczyk 1
Did you ever find a work around for this? I'm running into the same issue with no success.