Experience Salesforce

Sharing Rules in Salesforce

What You’ll Learn

  • What is Sharing Rules in Salesforce?
  • How to Create Sharing Rules in Salesforce?

In Salesforce, sharing rules are like access control mechanisms for your data. They determine who can see, edit, or delete specific records beyond what’s granted by the organization-wide defaults (OWD).

These rules aim to give access to records based on pre-defined criteria. Sharing rules are most valuable when OWDs are set to private or public read-only, as they can extend access without restricting access.

Let’s see what they are and how to implement them in your Salesforce org.

What is Sharing Rules in Salesforce?

Sharing rules in Salesforce creates automatic exceptions to the Organization-Wide Default settings for the users who do not own the record.

They should be applied to the objects whose org-wide defaults are set to Public Read-only or Private because sharing rules can only extend the access; they cannot restrict the access provided by Organization-wide defaults.

Types Of Sharing Rules In Salesforce

There are two types of Sharing Rules in Salesforce based on which records are to be shared:

1. Owner Based

Owner-based shares the records owned by specific users. Owners can be identified through public groups, roles and roles, and sub-ordinates.

2. Criteria Based

Criteria-based shares the records that meet specific criteria.

Parameters to Create Sharing Rules in Salesforce

Before creating sharing rules, administrators need to answer these three questions:

Q. 1 Share which records?

This identifies the records that need to be shared. They can be categorized based on the records’ owner or the criteria they meet.

Q. 2 With whom do the records need to be shared?

Records can be shared with public groups, roles, and roles & subordinates.

Q. 3 What kind of access should be provided for these records?

The users with whom the records are shared should have Read-Only or Read/Write access is decided by this question.

How to Create Sharing Rules in Salesforce?

Here is how you can create owner-based sharing rules in Salesforce.

  1. Confirm that the appropriate groups have been created if you plan to include public groups in your sharing rule.
  2. From Setup, enter Sharing Settings in the Quick Find box, then select Sharing Settings.
  3. In the Sharing Rules related list for the object, click New.
  4. Enter the label name and rule name. The label name appears on the user interface. The rule name is a unique name used by the API and managed packages.
  5. Optionally, enter a description of the sharing rule, up to 1,000 characters.
  6. For the rule type, select Based on record owner.
  7. Specify which users’ records are shared. For owned by members, select a category from the first dropdown list and a set of users from the second dropdown list or lookup field.
  8. Specify the users who get access to the data. For Share with, select a category from the first dropdown list and a set of users from the second dropdown list or lookup field.
  9. Select sharing access settings for users.
    1. Private
    2. Read Only
    3. Read/Write
    4. Full Access
  10. Click Save.
Start Your Salesforce Developer Journey CTA

Things to Keep in Mind

  • As they cannot restrict access, it gives Read-Only and Read/Write as access parameters in sharing rules.
  • They work best when they are defined for a particular group of users that can be determined or predicted in advance rather than a set of users that frequently changes.
Next Topic

Need Extra Support? Our FREE study materials have got you covered.

Our expert-prepared study materials provide the answers you need. Clear your doubts and improve your skills with detailed notes from industry professionals.