Salesforce Sharing Rules
Salesforce uses different layers to control who can see and use data. Sharing rules are one of the most important tools for managing record access. They help admins give access to users without changing roles or giving full permissions.
When data access is not managed properly, users may not see important records or may see too much data. Sharing rules help fix this by giving access in a controlled way.
This guide explains what sharing rules are, when to use them, and how to create and manage them step by step. It is useful for both beginners and experienced admins who want better control over data visibility.
👉 Salesforce Consulting Services
What Are Salesforce Sharing Rules?
Salesforce security works in layers. Each layer controls a different part of access.
Profiles and permission sets control what users can do, such as create, edit, or delete records. Organization-wide defaults (OWD) control what users can see by default.
The role hierarchy allows users higher in the structure to see records owned by users below them. This helps in management reporting and visibility.
Sharing rules come after these layers. They open access to records that users cannot see through OWD or role hierarchy.
Restriction rules can limit access further by using filters. Manual sharing allows users to share a single record with another user.
Sharing rules only open access. They cannot restrict access. They work by sharing records based on ownership or specific conditions.
👉 Salesforce Security Setup Services
Types of Sharing Rules in Salesforce
Salesforce provides two main types of sharing rules. Each type is used based on business needs.
1. Owner-Based Sharing Rules
Owner-based rules share records based on who owns them. These rules are useful when teams need to share data based on ownership.
For example, accounts owned by one team can be shared with another team. Opportunities owned by inside sales can be shared with field sales.
This type works well when ownership defines access.
2. Criteria-Based Sharing Rules
Criteria-based rules share records based on field values instead of ownership.
For example, cases with a specific type can be shared with a support team. Opportunities with a certain stage can be shared with finance.
These rules update automatically when record values change. This makes them flexible and easy to manage.
When to Use a Sharing Rule
Sharing rules are useful when access is needed across teams or roles without changing the role structure.
They are helpful when teams need to work together and share data regularly. They also reduce the need for manual sharing.
If OWD is set to private or read-only, sharing rules help open access in a controlled way.
Example Use Case of Sharing Rules
Consider a company with two sales regions. Each region has its own team and manager.
Managers need to see records from both regions to track performance and plan better.
In this case, an owner-based sharing rule can be created to share records between both regions.
This helps managers access data without giving full access to all records.
How to Create Sharing Rules in Salesforce
Follow these steps to create sharing rules in Salesforce.
Step 1: Review Your OWD Settings
Go to Setup and open Sharing Settings. Check if the object is set to Private or Read Only.
If not, sharing rules will not have any effect.
Step 2: Select the Object
Sharing Settings page par jaakar neeche scroll karein jab tak aapko Sharing Rules section na mil jaaye. Yahan par rules har object ke liye alag-alag dikhte hain. Ab jis object ke liye aap sharing rule add karna chahte hain (jaise Account, Opportunity, ya Case), usse dhundhein aur uske saamne “New” par click karein.
Step 3: Add Label and Description
Give a clear label and description for your sharing rule. The name should explain what records are being shared and with which users or group. A good label helps admins quickly understand the purpose of the rule in future.
It is best to keep the name simple, specific, and easy to read. Use proper naming format like Title Case and avoid using special characters. A clear description also helps other team members understand the rule without confusion.
Step 4: Choose Rule Type
You will see two main options when creating a sharing rule:
- Owner-Based Rule
- Criteria-Based Rule
Choose the rule type based on your business need. If you want to share records based on ownership, then select owner-based. If you want to share records based on field values, then select criteria-based.
For example, if you want to share all opportunities owned by a sales team with another department, you can select the owner-based rule. Then choose the correct role or group so that records are shared properly with the selected users.
Step 5: Define Sharing Target
Now you need to select who will get access to the shared records. Salesforce gives multiple options to choose from:
- Public Groups
- Roles
- Roles and Subordinates
- Territories or Territories and Subordinates
If you want to share records with multiple users or teams, using a public group is a better option. It helps reduce the number of rules and keeps management simple.
For example, if you want to share records with the finance team, you can select a role or a group that includes all finance users. This ensures that all related users get access without creating multiple rules.
Side Note on Portal Users
You can create sharing rules in Salesforce that let users from your website, portal, or Salesforce itself share data with one another. If portal users have licenses that include roles, you can even share records between users from different companies (accounts).
However, high-volume users, such as many community or site users, don’t have roles and can’t be added to public groups. Because of this, they can’t be part of owner-based sharing rules (rules that depend on who owns a record). Still, you can share records they own by using criteria-based or guest user sharing rules instead.
Step 6: Set Access Level
Now choose the level of access you want to give to the selected users. You will usually see two main options:
- Read Only (users can only view records)
- Read/Write (users can view and edit records)
Select the access level based on what the user needs to do with the data. For example, if a team only needs to check information, then Read Only is enough. If they need to update records, then Read/Write should be selected.
Also, keep in mind that sharing rules only control record access. Users must still have the correct object permissions in their profile or permission set. Without proper permissions, they may not be able to edit records even if Read/Write is selected.
Step 7: Save and Process
After setting everything, click on Save to create the sharing rule. Once saved, Salesforce will start updating record access based on the rule.
This process is called recalculation and it may take some time, especially if your organization has a large amount of data. During this time, users may not see changes immediately.
Once the process is complete, access will be updated automatically. Salesforce may also send a notification when the update is finished. It is a good practice to check records after saving to make sure the rule is working as expected.
Salesforce Health Cloud Services
Best Practices for Salesforce Sharing Rules
To use sharing rules effectively, follow these best practices.
Keep the sharing model simple. Too many rules can create confusion.
Use public groups to reduce the number of rules.
Avoid using high-level permissions like View All or Modify All unless needed.
Monitor the number of rules to maintain system performance.
Document all sharing rules and structure for better management.
Limitations and Important Considerations
Sharing rules have some limitations that should be understood.
They cannot restrict access, only open it.
There is a limit on the number of rules per object.
Some fields cannot be used in criteria-based rules.
If multiple rules apply, the highest level of access is given.
Once a rule is created, some settings cannot be changed and may require recreation.
Sharing one record may also make related records visible.
Troubleshooting Common Sharing Rule Issues
Sometimes sharing rules may not work as expected. Here are common issues and solutions.
If a user cannot edit a record, check if their profile allows editing.
If changes are not visible, wait for the system to complete processing.
If performance is slow, reduce the number of rules or use public groups.
Regular checks help in keeping the system efficient.
Summary
Salesforce sharing rules help manage record access in a simple and controlled way. They allow users to see the data they need without changing the entire system structure.
When used properly with OWD, roles, and permissions, sharing rules improve collaboration and data visibility.
Admins should keep the model simple, test changes properly, and document everything for better management.
Resources
Salesforce Help: Sharing Rules
Trailhead: Create Sharing Rules
Salesforce Developers: Sharing Rules
25+ Ways to Share a Record in Salesforce
FAQs
1. What are Salesforce sharing rules?
Salesforce sharing rules are used to give users access to records they cannot see by default. They help in managing data visibility between different users, roles, or teams in a simple way.
2. Can sharing rules restrict access?
No, sharing rules cannot restrict access to records. They are only used to open access and allow more users to view or edit records based on rules.
3. What are the types of sharing rules?
There are two main types of sharing rules: owner-based and criteria-based rules. Both are used to share records, but they work based on ownership or specific field values.
4. When should sharing rules be used?
Sharing rules should be used when data needs to be shared across different teams or roles. They help provide access without changing role hierarchy or giving full permissions.
5. Why are sharing rules important?
Sharing rules are important because they improve team collaboration and ensure users can access the data they need. They also help maintain proper data security and control.
6. What is the limit of sharing rules in Salesforce?
Salesforce allows up to 300 sharing rules per object, including both owner-based and criteria-based rules. Keeping rules within limits helps maintain system performance.
7. How to fix sharing rule issues?
To fix issues, check user permissions, confirm rule settings, and wait for recalculation to complete. Simplifying rules and using public groups can also improve performance.