7

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 it.

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 the sharing settings in Salesforce, we decided which records are to be shared:

1. Owner-Based Sharing Rules

The owner shares the records owned by specific users. Owners can be identified through public groups, roles, and subordinates, and the records are shared with a defined set of users needing access.

2. Criteria-Based Sharing Rules

Criteria-based shares the records that meet specific criteria on field-based conditions, no matter who owns the record. This is useful when access needs to be identified as per the nature of the record rather than its ownership.

Parameters to Create Sharing Rules in Salesforce

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

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

2. With whom the records are shared – Records can be shared with public groups, roles, and subordinates.

3. What level of access is provided – The users with whom the records are shared should have Read-Only or Read/Write access, as decided by this question.

Practice Exam
eGuide form

Sharing Rules Practice Exam!

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 the 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 the lookup field.
  9. Select sharing access settings for users.
    1. Read Only
    2. Read/Write
    3. Full Access (Only for manual sharing)
  10. Click Save.
Start Your Salesforce Developer Journey CTA

Things to Keep in Mind

Role hierarchy grants access to managers of records that their subordinates hold. Using sharing rules in Salesforce, one can extend access to different roles or departments.

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.

Salesforce allows a maximum of 300 Sharing Rules per object, with around 50 criteria-based sharing rules. Ensure to plan the sharing strategy accordingly. 

Next Topic

Need more support?

Get a head start with our FREE study notes!

Learn more and get all the answers you need at zero cost. Improve your skills using our detailed notes prepared by industry experts to help you excel.

Frequently Asked Questions

What is the difference between owner-based and criteria-based sharing rules?

Owner-based sharing rules allow users to share records as per the ownership of a user in a specific role. The criteria-based sharing rules are based on field values.

Can sharing rules restrict access in Salesforce?

No, the sharing rules can extend the access beyond OWD. They can not restrict access.

How many sharing rules can you create per object in Salesforce?

You can create 300 sharing rules per object and a maximum of 50 criteria-based sharing rules for all custom and standard objects.

What is the difference between sharing rules and manual sharing?

The sharing rules vs manual sharing Salesforce is a big debate on what to use. Sharing rules are used when a group of users require consistent access to a record, whereas Manual sharing is for giving immediate access to a specific record.

Book Free15-Minutes Career Counselling