Create Sharing Rule
sf_create_sharing_ruleCreate a Salesforce sharing rule to extend org-wide defaults by granting access to specific roles, groups, or queues based on criteria or ownership.
Instructions
Creates a Sharing Rule for a Salesforce object. Sharing Rules extend the OWD by automatically sharing records with users who meet criteria (criteria-based) or who own records (ownership-based). Use to give specific roles/groups access to records they wouldn't normally see based on OWD.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | Yes | Display label | |
| ruleName | Yes | Sharing rule developer name | |
| ruleType | No | criteria: share based on field values. ownership: share based on record owner. | criteria |
| sharedTo | Yes | Who receives the sharing | |
| objectName | Yes | Object API name, e.g. 'Account', 'Opportunity' | |
| sharedFrom | No | For ownership-based rules: whose records are shared | |
| accessLevel | No | Access level granted | Read |
| criteriaItems | No | For criteria-based rules: conditions that trigger sharing |