Sharing Rules in Salesforce and Its Types

I worked for an organization that uses Salesforce to manage data security. We set up the organization-wide default to be private so that no one could access other users’ data. But now, we need to give other users access to some records. To achieve this requirement, we have a sharing rule feature in Salesforce.

Here, I will explain Salesforce sharing rules and their types, and then show you how to create an owner-based and a criteria-based sharing rule in Salesforce. Additionally, I will explain manual sharing and how to set up manual sharing in Salesforce.

Sharing Rules in Salesforce and Its Types

A Salesforce sharing Rule allows us to extend access to records beyond what is granted by the organization’s defaults. Sharing Rules provide users access to records they do not own or usually cannot see based on criteria such as role, public group, or record ownership.

The Sharing Rule helps users share records based on conditions. We use it for objects whose organization-wide defaults(OWD) are set to public, read-only, or private. When creating sharing rules, we can set the level of access (read-only or read/write).

Types of Sharing Rules

  • Owner-Based Sharing Rules: In Salesforce, owner-based sharing rules extend access to records based on their ownership. This means that users who own certain records can share them with other groups or roles.
  • Criteria-Based Sharing Rules: In Salesforce, criteria-based sharing rules are used when we want to share records that meet particular criteria or conditions.
  • Manual Sharing: Manual sharing in Salesforce allows us to grant specific users access to records (such as accounts, opportunities, or cases) that they usually don’t see.

Create an Owner-Based Sharing Rule in Salesforce

Using the following steps, we will see how to create an owner-based sharing rule.

  1. Go to Setup. -> Home Page. -> Quick Find Box search for ‘Sharing Settings‘ and click on it.
Sharing Rules in Salesforce
  1. Scroll down to the Sharing Rules section and click the New button for the object you want to create a sharing rule for. Here, I’m creating on Lead Object.
Owner Based Sharing Rules in Salesforce
  1. Now, enter the Label, and the Rule Name will automatically populate.
Create Owner based Sharing rule in Salesforce
  1. In the Rule Type field, select the Based on Record Owner option.
Create Owner based Sharing rule for object in Salesforce
  1. In Lead: Owned by members of the option, we can select Public Group, Queues, Roles, Roles & Subordinates. Here, I have chosen Roles.
    • Then, in the next dropdown list, you will see all the roles you need to select based on which roles you want to share records. Here, I want to share records owned by the Marketing Team.
Salesforce Create Owner based Sharing rule in Lightning
  1. Here, you need to select with whom you want to share records. I have selected Roles, but a different role team.
What is Sharing Rules in Salesforce
  1. In the Sharing Rule, we can extend access to users or groups, but cannot restrict them, as they already have access. I have selected the access as Read/Write.
    • After setting up all the steps, click on the Save button.
Salesforce Lightning Owner based sharing rule
  1. As we click on the Save button, a pop-up window will appear on the screen for confirmation to create a sharing rule. In this window, click on the OK button.
Owner based Sharing Rule in Salesforce Lightning
  1. As we click on the OK button for confirmation, here you can see the sharing rule has been created successfully.
Salesforce Sharing Rules

This is how we can create an owner-based sharing rule in Salesforce.

Create a Criteria-Based Sharing Rule in Salesforce

Using the following steps, we will see how to create a criteria-based sharing rule.

  1. Go to Setup. -> Home Page. -> Quick Find Box search for ‘Sharing Settings‘ and click on it.
    • Scroll down to the Sharing Rules section and click the New button for the object you want to create a sharing rule for. Here, I’m creating a Lead Object.
    • Now, enter the Label, and the Rule Name will automatically populate.
Setup Criteria based Sharing for object in Salesforce
  1. This time, in the Rule Type field, select the Based on Criteria option.
Salesforce Lightning setup criteria based sharing rule
  1. In this step, we will define the criteria for sharing. To do so, go to the Criteria section and specify the Field, Operator, and Value. If the specified criteria for the records are met, those records will be shared.
    • In this example, I have applied the criteria for City, Country, and Industry fields.
Salesforce Lightning Specify criteria for Sharing rules
  1. Specify the users who get access to the data. In the field Share with, select a category from the first dropdown list and a set of users from the second dropdown list.
    • In this example, I have selected the Category Roles and Subordinates and the Set of Users as the Marketing Team.
Select users to setup criteria based sharing rules
  1. In this step, select the users’ access level. In this case, I have selected Read/Write as the access. At last, click on the Save button.
Create Criteria based Sharing rules in Salesforce
  1. As we click on the Save button, a confirmation message will appear on the screen; click on the OK button.
Create Criteria based Sharing rules in Salesforce Lightning
  1. The criteria-based sharing rule will be created in the object’s sharing rules section. In this example, I have specified the sharing rule in the Leads object so it will be visible in the Lead Sharing Rules.
Criteria based Sharing Rule in Salesforce Lightning

In this way, we can set up Criteria-Based Sharing Rules in Salesforce.

What is Manual Sharing in Salesforce

Using the criteria-based and owner-based sharing rules, the records are shared in groups, but manual sharing takes place when we need to share a particular record with a specific user, group, or role.

Manual sharing is the process of manually granting access to a particular record. When sharing the records manually, we can give the people with whom we want to share read-only or read/write access.

Who can share Salesforce Records?

  1. Administrator.
  2. A user who has full access to records.
  3. Record Owner.
  4. The user whose role is above the record owner in the role hierarchy.

Set up Manual Sharing in Salesforce

Before sharing records manually, you need to set up and activate some functionality. The following steps can help you achieve manual sharing in Salesforce.

  1. On the Home Page, click the “Gear icon,” then select “Setup” from the dropdown. On the setup page, “Quick Find Box” -> Search ”Sharing Setting” -> Click on “Sharing Setting.”
Manual Sharing in Salesforce
  1. Click on the Edit Button to activate it.
Setup Manual Sharing in Salesforce
  1. Scroll down in “Other Settings” -> click on “Manual User Record Sharing” -> Save it.
Share Records Using Manual Sharing in Salesforce

Share Records Using Manual Sharing in Salesforce

Once you activate “Manual User Record Sharing” to share records manually, follow the steps below.

  1. Select the object. Here, I have selected the “Employee” object.
    • Go to the Record that you want to share.
    • Click on the dropdown arrow on the standard button bar.
    • You will find the “Sharing” button; click it.
Salesforce Manual Sharing
  1. Select the user to whom you want to share the record.
    • Select employee access level. Here, I have selected “Read-only” -> Click on Save.
    • Read Only – The receiver user can only read this record.
    • Read/Write – The receiver user can edit this record.
Manual Sharing in Salesforce

In this way, we can set up manual sharing in Salesforce.

Conclusion

In this Salesforce tutorial, we learned about the sharing rules in Salesforce. We have seen what a sharing rule is, the types of sharing ruleshow to create an owner-based sharing rule, and criteria-based sharing rules in Salesforce, with examples and step-by-step explanations.

Additionally, I explained what manual sharing is and how to set up manual sharing in Salesforce so that we can share a particular record with a specific user, group, or role.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.