How can we identify an SObject's parent(s) when the Sharing Setting is "Controlled by Parent"?
Three of them have a ParentId field, and therefore, a clear parent.
- Contact Point Email
- Contact Point Phone
The other three -- Contact, Activity, and Order -- do not have a Parent Id field.
- Contact has an AccountId. It seems that only a contact's account would be its parent. However, the help page Set Your Organization-Wide Sharing Defaults has this note:
When the default access for contacts is Controlled by Parent and you increase the default access for accounts, opportunities, or cases, the changes take effect after recalculation is run.Therefore, it's clear that a contact can have parents other than its account.
- Order has AccountId, four Contact Ids, and a Contract Id.
- Activity has a WhatId and a WhoId.
So, is there metadata or help documentation somewhere that tells us specifically which SObjects and fields to look at to determine a contact, order, or activity's parent? Or are the steps to determine a contact, order, or activity's parent just something we have to almost-mystically know or derive from the data model?
For example: For Contact, is it just known that the parents are, potentially, an account via Contact.AccountId, zero to many opportunities via OpportunityContactRole, and zero to many cases via Case.ContactId? What about possible parent-like relationships like Contact.AccountId to Account.Id to Case.AccountId; if you can can see a Case, is it documented that you can see all of the Case's Account's Contacts?
For what it's worth, the ContactShare.RowCause field has fifteen options. None appear expressly relevant to sharing that is based on the aforementioned opportunities or cases. The 15 are: Owner, Manual Sharing, Sharing Rule, Account Sharing, Associated record owner or sharing, Person Contact, Sales Team, Territory Assignment Rule, Territory Manual, Territory Sharing Rule, Territory assignment for forecasting and reporting, Guest User Sharing Rule, Associated guest user sharing, Associated Guest User Sharing, and Survey Sharing Rule. (Incidentally, the AssetShare.RowCause field has the same 15 options.)
Incidentally, it does not appear possible to create a new custom SObject that can have a "Controlled by Parent" option on the Sharing Settings page. (Whether a custom SObject is "Controlled by [its] Parent" depends on whether it has a Master-Detail field on it. If it does, then it is "Controlled by [its] Parent" and it isn't displayed at all on the Sharing Settings page.)