Apex Sharing Reason for Standard Objects: Why RowCause = Manual 

When you add programmatic shares to standard objects (Account, Contact, Case, Lead, etc.), you can’t create a custom Apex Sharing Reason. Custom reasons exist only for custom objects. On standard objects, the supported approach is to insert a share row with RowCause = Manual in the relevant Share object (for example, AccountShare). This makes your intent auditable while staying fully compatible with Salesforce’s sharing engine. 

On Accounts specifically, a single AccountShare row can also carry related access—OpportunityAccessLevel, CaseAccessLevel, and (in some contexts) ContactAccessLevel—useful when policies require consistent visibility across parent and child records. Be aware that some combinations (for example, setting All/Full Access through the API) aren’t valid on create/update; use Read or Edit in programmatic scenarios. 

As a rule, apply declarative controls (OWD, role hierarchy, sharing rules, account teams) for broad policies. Use Apex sharing only when you need dynamic, per-record logic the rules can’t express—then tag those grants consistently with Manual. This aligns with Salesforce’s guidance on Understanding Sharing and keeps recalculations predictable when your OWD changes

SFDC247

Leave a Reply

Your email address will not be published. Required fields are marked *