What is the operational difference between owner-based and criteria-based sharing rules in Salesforce?
Answer
Basics: Sharing rules extend access beyond OWD and role hierarchy to groups of users, horizontally across the org. They can only grant additional access (Read Only or Read/Write), never restrict.
How it works: Setup > Sharing Settings > select object > Sharing Rules > New.
- Owner-based: "Records owned by" [public group, role, role and subordinates, queue, territory] are shared with [public group, role, role and subordinates] at Read Only or Read/Write. Example: share records owned by the Sales role with the Support group.
- Criteria-based: define field criteria (e.g., Region equals EMEA AND Status equals Active) and share all matching records with a target group/role, regardless of owner.
- For Account sharing rules you can also set access to related Contacts, Opportunities and Cases.
- Saving triggers an async recalculation; new or changed records re-evaluate automatically.
Advanced / deep dive: Criteria-based rules cannot reference every field type; some field types (and the Owner field) are not available, so verify supported types. There are per-object caps, commonly 300 sharing rules in total with a smaller cap (commonly 50) on criteria-based rules; verify current limits. Sharing rules create rows in the object's share table with RowCause = 'Rule'; many rules on large objects slow recalculation. Where rules cannot express the logic (complex, dynamic, user-driven), use Apex managed sharing with a custom Apex sharing reason, or Enterprise Territory/Account Teams. Owner-based rules do not apply to records owned by queues unless the queue is the source group. Sharing rules do not give access if the user lacks object-level permission.
Code / config example:
Criteria-based rule on Case:
Label: Share Premium Cases with Tier-2 Support
Criteria: Case.Priority equals High AND Case.Account Tier equals Premium (use a field on Case if needed)
Share with: Public Group "Tier 2 Support"
Access: Read/Write