Loading...
Loading...
Use when the user wants to retrieve or update Organization-Wide Default (OWD) sharing settings for Salesforce objects. TRIGGER when: user asks to check current OWD settings, view sharing defaults, change default access levels (Private, Public Read Only, Public Read/Write, Controlled by Parent), configure internal or external access for standard or custom objects, mentions org-wide defaults, wants to make records private or restrict who can see records, wants to control default record visibility for an object, or references .settings-meta.xml sharing fields or sharingModel in .object-meta.xml files. DO NOT TRIGGER when: user asks about sharing rules, criteria-based sharing, role hierarchy, or manual sharing — delegate to platform-sharing-rules-generate.
npx skill4agent add forcedotcom/sf-skills platform-sharing-owd-configureAccountContactInvoice__csf data query --query "SELECT QualifiedApiName, InternalSharingModel, ExternalSharingModel FROM EntityDefinition WHERE QualifiedApiName = '<ObjectName>'" --use-tooling-api --target-org <org>sf data query --query "SELECT QualifiedApiName, InternalSharingModel, ExternalSharingModel FROM EntityDefinition WHERE IsCustomizable = true ORDER BY QualifiedApiName" --use-tooling-api --target-org <org>references/access_levels.mdreferences/access_levels.mdsf project retrieve start --metadata CustomObject:<ObjectName> --target-org <org><ObjectName>.object-meta.xml<sharingModel><externalSharingModel>references/metadata_api_approach.md<sharingModel><externalSharingModel>.object-meta.xmlreferences/metadata_api_approach.mdControlledByParentreferences/access_levels.mdreferences/access_levels.mdsf project deploy start --metadata CustomObject:<ObjectName> --target-org <org>| Constraint | Rationale |
|---|---|
Objects with Master-Detail relationships must use | Platform enforces this — attempting other values fails |
| External access cannot be more permissive than internal access | Salesforce rejects configurations where external > internal |
| Some standard objects have fixed OWD (e.g., User, Activity) | Not all objects support OWD changes |
| Changing OWD to more restrictive triggers sharing recalculation | This can take significant time on large orgs — warn the user |
Custom objects default to | Users may not realize the default is permissive |
| Always verify the org connection before querying | Prevents confusing error messages |
| Issue | Resolution |
|---|---|
| User needs Manage Sharing permission or System Administrator profile |
| OWD change appears stuck | Sharing recalculation is running — check Setup > Sharing Settings for progress |
| Custom object not found in query | Use the full API name including |
| Object has no Master-Detail relationship — use Private, Public Read Only, or Public Read/Write |
| External access field not showing | External sharing model only appears when external org-wide defaults are enabled |
| Query returns no results | Object may not be customizable or API name may be incorrect — verify spelling |
| Need | Delegate to |
|---|---|
| Creating sharing rules after restricting OWD | |
| Deploying metadata changes to another org | |
| File | When to read |
|---|---|
| When validating or explaining OWD access level values |
| When using Metadata API to update OWD instead of Tooling API |
| To verify formatted output matches expected structure |
| To verify update confirmation matches expected structure |