What is Sharing Rule in Salesforce?
Updated · By the Clientell AI team · How we write
A sharing rule in Salesforce is an automatic rule that gives extra users or groups access to records they would not otherwise see. It can only open access, never close it. Admins use sharing rules when org-wide defaults are Private or Public Read Only. The types are owner-based, criteria-based and guest user rules.
Key facts
- Purpose
- Extend record access beyond org-wide defaults and the role hierarchy
- Types
- Owner-based, criteria-based, guest user (Salesforce Help)
- Limit per object
- 300 sharing rules in total, and 50 criteria-based or guest user rules (Platform Sharing Architecture)
- Raising the limits
- Support can raise the totals, up to 500 rules and 200 criteria-based rules per object (Salesforce Help)
- Access granted
- Read Only or Read/Write. Guest user rules give Read Only.
- Cannot do
- Restrict access. Sharing can only open records up.
Clientell AI, the AI Salesforce admin, audits your Sharing Rule setup in a read-only scan, then drafts the fixes. See permission management
Try it in Clientell AI
“Audit my Sharing Rule setup: show where access is too open, list who has more than they need, and draft fixes for me to approve.”
Clientell AI reads your org first. Platform deployments include rollback. How security works.
What is a sharing rule in Salesforce?
Salesforce decides record access in layers. Org-wide defaults set the floor. The role hierarchy lets managers see what their reports own. A sharing rule adds access on top for people outside that line (Salesforce Help).
Example: OWD on Opportunity is Private. Sales reps see only their own deals. A sharing rule can share all opportunities owned by the West sales team with the Finance group, Read Only. Finance sees them without any change of ownership.
If OWD is Public Read/Write, there is nothing to open up, so sharing rules do nothing on that object.
What are the types of sharing rules in Salesforce?
Pick the type by how you can describe the records to share.
| Type | Shares records based on | Typical use |
|---|---|---|
| Owner-based | Who owns the record (a role, public group or queue) | Share everything the West team owns with the Support group |
| Criteria-based | A field value, such as Opportunity.Region__c equals EMEA | Share all high-value cases with a specialist team |
| Guest user | A field value, for unauthenticated guest users of an Experience Cloud site | Show public records on a public site, Read Only |
How many sharing rules can you create per object?
These limits and rules come from Salesforce's sharing documentation.
- Each object can have 300 sharing rules in total, and 50 of them can be criteria-based or guest user rules (Platform Sharing Architecture).
- Support can raise the limits, up to 500 rules per object and 200 criteria-based rules per object (Salesforce Help).
- Criteria-based rules are not available on every object. For Product2, you can create only guest user rules (Salesforce Help).
- Criteria cannot use lookup, encrypted or formula fields.
- Guest user rules grant Read Only access and apply only to unauthenticated guest users.
Sharing rule vs role hierarchy vs manual sharing: which to use?
Each tool answers a different need. Use the simplest one that fits.
| Tool | How access is granted | Use it when |
|---|---|---|
| Role hierarchy | Managers inherit access to records owned by people below them | Access follows the reporting line |
| Sharing rule | Automatic, based on owner or field value | A defined group needs access across the org |
| Manual sharing | A user shares one record by hand | One-off exceptions |
Example: share West opportunities with Finance
Use a sandbox first. OWD for Opportunity must be Private or Public Read Only.
- 1. Setup > Sharing Settings. Find Opportunity Sharing Rules and click New.
- 2. Name the rule West to Finance. Choose Based on record owner.
- 3. Under Opportunities owned by members of, pick Roles: West Sales.
- 4. Under Share with, pick Public Groups: Finance.
- 5. Set Opportunity Access to Read Only and save.
- 6. Wait for the recalculation to finish. On large objects this can take time, so run it off-peak.
- 7. Check: open an Opportunity owned by West and click Sharing. Finance appears with Read Only. To undo, delete the rule.
What are common sharing rule mistakes?
Most sharing bugs come from one of these.
- Setting OWD to Public Read/Write to avoid sharing work. Fix: start Private on sensitive objects and open up with rules.
- Using a sharing rule to fix a field problem. Fix: use field-level security, since sharing only decides which records a user sees.
- Piling up overlapping rules. Fix: use public groups so one rule serves many teams.
- Expecting a rule to remove access. Fix: tighten OWD instead, since rules only open access.
FAQ: Sharing Rule in Salesforce
What are sharing rules in Salesforce?
Rules that automatically give extra users or groups access to records beyond what org-wide defaults and the role hierarchy allow (Salesforce Help).
What are the types of sharing rules in Salesforce?
Owner-based rules, criteria-based rules and guest user rules (Salesforce Help).
How many sharing rules can I create per object?
300 in total, and 50 of them can be criteria-based or guest user rules (Platform Sharing Architecture). Support can raise these limits (Salesforce Help).
Can a sharing rule restrict access?
No. Sharing rules only open access. To restrict records, set org-wide defaults to a stricter level.
What is the difference between a sharing rule and the role hierarchy?
The role hierarchy gives managers access to their team's records. A sharing rule gives access to any group you define, whatever the hierarchy.
Can I use formula fields in criteria-based sharing rules?
No. Lookup, encrypted and formula fields cannot be used as criteria (Salesforce Help).
Sources: Salesforce Help: Sharing Rules, Salesforce Help: Sharing Rule Considerations, Salesforce Help: Sharing Rule Types, Salesforce Help: Increase the Sharing Rules Limit, Salesforce Architects: Platform Sharing Architecture. Last reviewed .
Related Salesforce Terms
3 termsOrganization-Wide Defaults (OWD)
SecurityOWD (Organization-Wide Defaults) set the baseline record access for each object: Private, Public Read Only, Public Read/Write, or Controlled by Parent. Role hierarchy and sharing rules can only open access further, never close it.
Role Hierarchy
AdministrationThe Role Hierarchy in Salesforce controls record-level visibility by granting users access to records owned by anyone below them in the hierarchy tree.
Field-Level Security (FLS)
SecurityFLS (Field-Level Security) controls which users can see or edit each field, set per profile or permission set. A field with no access is hidden everywhere: layouts, reports, list views and API responses.
What should I read next?
More in Security
View all →Field-Level Security (FLS)
FLS (Field-Level Security) controls which users can see or edit each field, set per profile or permission set. A field with no access is hidden everywhere: layouts, reports, list views and API responses.
Organization-Wide Defaults (OWD)
OWD (Organization-Wide Defaults) set the baseline record access for each object: Private, Public Read Only, Public Read/Write, or Controlled by Parent. Role hierarchy and sharing rules can only open access further, never close it.
Shield Platform Encryption
Shield Platform Encryption encrypts sensitive data at rest in Salesforce using tenant-specific encryption keys, protecting it beyond standard database-level encryption.
Connected App
A Connected App is the Salesforce setting that lets an outside app sign in and call Salesforce APIs through OAuth 2.0 or SAML. Salesforce issues a Consumer Key and Secret, and you control scopes, sessions and IP rules.
Try this on your own org
Start the 14-day free trial, no card. Clientell AI asks before it changes anything in production.
14-day free trial · No credit card required