Has anybody bumped into this error when spinning a new scratch org?
Here's how this happened. I created a new scratch org and created 2 objects. One had a lookup field to the other. Then I pulled that change locally using SFDX. Later I changed the lookup relationship to a Master-Detail one. However SFDX never picked up the change.
Now I am trying to re-spin the scratch org(it expired) and I am getting this Cannot set sharingModel to ReadWrite on a CustomObject with a MasterDetail relationship field
.
SF's documentation says that the sharingModel indicates the organization-wide defaults for the object.
Link: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customobject.htm
Again based on SF's documentation: The detail record inherits the sharing and security settings of its master record.
So I am thinking that this is happening because the detail record should inherit the sharingModel
from the parent but instead it's specified as ReadWrite
in the metadata file. How should I handle this?
ControlledByParent
. I think this might solve it.Must specify a sharing model value for the Custom Object