commerce-b2b-open-code…
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce…
Use when the user wants to retrieve or update Organization-Wide Default (OWD) sharing settings for Salesforce objects. TRIGGER on org-wide defaults, checking/viewing sharing defaults, changing default access levels (Private, Public Read Only, Public Read/Write, Controlled by
$ npx -y skills add forcedotcom/sf-skills --skill platform-sharing-owd-configure --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/platform-sharing-owd-configureContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when the user wants to retrieve or update Organization-Wide Default (OWD) sharing settings for Salesforce objects. TRIGGER on org-wide defaults, checking/viewing sharing defaults, changing default access levels (Private, Public Read Only, Public Read/Write, Controlled by
name: platform-sharing-owd-configure
description: "Use when the user wants to retrieve or update Organization-Wide Default (OWD) sharing settings for Salesforce objects. TRIGGER on org-wide defaults, checking/viewing sharing defaults, changing default access levels (Private, Public Read Only, Public Read/Write, Controlled by Parent), internal/external access for standard or custom objects, making records private, or sharingModel in .object-meta.xml files. DO NOT TRIGGER for sharing rules, criteria-based sharing, role hierarchy, or manual sharing — delegate to platform-sharing-rules-generate."
metadata:
relatedSkills:
- "platform-metadata-deploy"
- "platform-sharing-rules-generate"
version: "1.2"
domains: ["Platform"]
cliTools:
- tool: ["sf"]
semver: ">=2.0.0"Retrieve and update Organization-Wide Default (OWD) sharing settings for standard and custom objects in a Salesforce org. OWDs define the baseline level of access users have to records they do not own.
---
Before proceeding, confirm with the user if not already clear:
---
Gather or infer before proceeding:
Defaults unless specified:
---
All steps are sequential. Do not skip or reorder.
1. **Query current OWD settings** using the Salesforce CLI Tooling API: `sf data query --query "SELECT QualifiedApiName, InternalSharingModel, ExternalSharingModel FROM EntityDefinition WHERE QualifiedApiName = '<ObjectName>'" --use-tooling-api --target-org <org>`
2. **For retrieving all OWD settings at once:** `sf data query --query "SELECT QualifiedApiName, InternalSharingModel, ExternalSharingModel FROM EntityDefinition WHERE IsCustomizable = true ORDER BY QualifiedApiName" --use-tooling-api --target-org <org>`
3. **Present results clearly** — read `references/access_levels.md` for valid values and display a formatted table to the user.
4. **Check for immutable/fixed OWD** — read `references/access_levels.md` "Immutable / Fixed OWD Objects" section. If the requested change targets a fixed value (e.g., Price Book external OWD), **stop immediately** and explain to the user that this value is platform-fixed and cannot be changed by any means. Do not attempt a deploy.
5. **Validate the requested access level** — read `references/access_levels.md` to confirm the value is valid for the target object. If the value is not in the allowed set for that object, explain what values are valid and ask the user to choose one. Do not guess alternative values.
6. **Retrieve the object metadata** using the Metadata API (same command for both standard and custom objects): `sf project retrieve start --metadata CustomObject:<ObjectName> --target-org <org>`. This retrieves `<ObjectName>.object-meta.xml` containing `<sharingModel>` and `<externalSharingModel>`. See `references/metadata_api_approach.md` for the full procedure.
7. **Modify the sharing settings** — update the `<sharingModel>` (internal access) and/or `<externalSharingModel>` (external access) in the object's `.object-meta.xml`. Read `references/metadata_api_approach.md` for details.
8. **Pre-deploy verification** — before deploying, confirm:
9. **Deploy the updated settings:** `sf project deploy start --metadata CustomObject:<ObjectName> --target-org <org>`.
10. **Handle deploy failure (max 2 attempts):** If the deploy fails:
11. **Verify the change** by re-running the query from Phase 1, Step 1.
---
| Constraint | Rationale | |-----------|-----------| | Objects with Master-Detail relationships must use `ControlledByParent` | Platform enforces this — attempting other values fails | | External access cannot be more permissive than internal access | S
This repository provides a curated collection of Salesforce agent skills for building applications.
Repo: forcedotcom/afv-library
Integrate Salesforce B2B Commerce open source components from GitHub into B2B Commerce…
Replace OOTB (out-of-the-box) B2B Commerce components with open source equivalents in site…
Use this skill to diagnose and resolve what blocks a DevOps Center promotion of a work item's…
Use this skill to manage the full lifecycle of a DevOps Center pipeline — list all pipelines,…
Use to list, view, or manage DevOps Center projects in a Salesforce org — show all projects,…
Analyzes DevOps Center test failures and Code Analyzer violations in plain language — failure…