When you want to share a record with multiple users who are connected by horizontal hierarchy, then we use Sharing rules. Sharing rules are only used to extend the access provided based on the permission given by the record owner. They cannot restrict the access provided by OWD or Role hierarchy. Record access can be granted to public groups, roles, roles & subordinates and portal roles based on the permission provided by the record owner.

Rule Categories in Salesforce

Salesforce employs various types of rules to automate tasks, maintain clean data and control who has view access to what. Each of this type of rule has its own domain and a place in the system.

Validation Rules

Validation rules check the data users enter to make sure it meets your company’s standards before it is saved. They stop bad or incomplete information from entering your system.

  • Require fields to have values or match a format (like email addresses)
  • Show clear error messages when data doesn’t fit rules
  • Prevent records from saving until corrections are made
  • Apply to standard and custom objects alike
  • Help maintain data quality across your org

Assignment Rules

Assignment rules send records to the right people or queues automatically. They cut down on manual hand-offs and speed up work.

  • Route leads or cases based on criteria like region or product
  • Assign records to users, roles, or public groups
  • Support round-robin or load-balancing assignments
  • Trigger email alerts when a new record is assigned
  • Ensure cases don’t languish unassigned

Sharing Rules

Sharing rules open up record access beyond the default settings. They let you share records with groups of users based on criteria you define.

  • Share accounts, opportunities, or custom objects to roles or public groups
  • Grant Read Only or Read/Write access as needed
  • Override private sharing settings for special teams
  • Keep sensitive data locked down for everyone else
  • Update dynamically when records meet sharing criteria

Workflow Rules

Workflow rules allow you to automate standard internal procedures and processes to save time across your organization. They are operating in the background, with the user not having to click.

  • Send automatic email notifications to users or customers
  • Update fields or create follow-up tasks instantly
  • Trigger outbound messages to external systems
  • Define entry and evaluation criteria clearly
  • Chain multiple actions in a single workflow

Scoping Rules

Scoping rules control how interactive tools like Flow or Approval Processes move between records and users. They set the boundaries for those processes.

  • Limit which records a flow can read or write
  • Define which users can trigger an approval step
  • Keep processes focused on relevant data sets
  • Prevent accidental changes outside the intended scope
  • Improve flow performance by narrowing data

Restriction Rules

Limitation rules further limit access by preventing specific users or profiles from reading and writing records in particular circumstances. They are an extra level of security.

  • Conceal records with respect to field values or user roles
  • Prevent edits on locked or closed records
  • Block visibility of sensitive information fields
  • Work alongside sharing settings for fine-tuned control
  • Ensure compliance with data policies

Product Rules

Product rules guide users during product configuration and quoting, often in Salesforce CPQ. They enforce bundle requirements, pricing constraints, and valid combinations.

  • Enforce required components in a product bundle
  • Prevent incompatible product combinations
  • Automatically add or remove products based on selections
  • Apply discounts or surcharges under set conditions
  • Help sales reps build accurate quotes quickly

Important Considerations

Use best practices to create and manage rules in Salesforce, and ensure that your organization maintains a steady, safe course.

  • Sandbox Testing: Develop new rules in sandbox and test before deploying to production.
  • Use Descriptive Naming: Name the rules something that makes sense to admins who aren’t themselves the product owner.
  • Record Logic: Document reasons all rules in one place, what triggers the rule, and what you hope to achieve by having the rule.
  • Monitor Performance: If you have dozens of rules running against a single object, look for slowdowns.
  • Rule Order: Keep in mind Salesforce’s rule order so to not get confusion or conflict.
  • Regular Reviews: Revisit rules at least periodically, to retire dated ones, and accommodate the evolving business requirements.

Use these tips to make sure your own Salesforce rules are ruling responsibly – following best practices, easy to manage, and in alignment with your team’s goals.

Components of Sharing Rules:

Every sharing rule has three components-

1. Share which Records:

A record can be shared based on the ownership of a record or meeting certain criteria. We can only share the records of a particular user with other users. We can also share a record based on a field value in the record.

2. With which User:

A public group can be created to simplify sharing rule creation. A public group can be a combination of individual users, roles, roles & subordinates, other public groups that all have common functions.

3. What kind of Access:

We can provide access based on the requirement. It can be Read-only or Read and write access.

I’m creating a sharing rule to provide access to a Public Group

Steps to create Sharing Rule:

Create a public Group with the users who require similar access.

Steps to Create a Public Group

1. Navigate to Setup -> Administer -> Manage Users -> Public Groups
2. Click on ‘New’ Button. You’ll be navigated to the below screenSteps-to-Create-a-Public-Group-sharing-rules-in-salesforce
3. Provide Label, I’m giving as ‘Group1’.
4. In the search pick list, you have to select the type of users whom you want to add to the public group.add-users-to-a-new-public-group-in-salesforce
5. Here, I’ve selected ‘Users’. The list of existing users is shown in the Available Members as given above.Connect-Salesforce-ERP

6. As I’m using developer edition, there are only a few users. Select the users you want to add to the public group and click on Save button. I’ve selected 3 users from the above list and clicked on ‘Save’ button.save-users-to-a-new-public-group-in-salesforce7. Now, a new public group is created with the name ’Group1’.

Steps to Create Sharing Rule

1. Navigate to Setup -> Security Controls -> Sharing Settings. Below screen will be shown.steps-to-create-a-sharing-rule-in-salesforce

2. There you can find a picklist ‘Manage Sharing Settings for’, which contains the list of objects existing in Salesforce.
3. Select an object from the picklist. I’ve selected the ‘Accounts’ object. After selecting the object, you’ll be navigated to below screen.Sharing-rule-in-salesforce
4. Click on the ‘New’ button. You’ll be navigated to below screen where you need to provide the details of sharing rulenew-account-sharing-rule-in-salesforce
5. In step 1, I’ve given the Name as ‘Account Sharing Rule1’.
6. In step 2, select the type of rule. Here, we need to select the criteria based on which we need to share the record. I’m selecting the rule as ‘Based on Record Owner’.Connect-Salesforce-ERP
7. In step 3, select the members whose records need to be shared. It’s a picklist which contains the group of users.Account-Sharing-Rule-salesforce
8. I’ve selected ‘Role’ then the list of roles will be displayed in the picklist next to this picklist. I’ve selected ‘VP Human Resources’.
9. In step 4, select the users with whom you want to share the records. I’m selecting the public group ‘Group1’ which is created above.
10. In step 5, select the level of access for the users selected in step5. You can give Read only/ Read/Write access on ‘Default Account and Contract Access’. You can give Private/Read-only/Read/Write on ‘Opportunity and Case’ objects.
11. Provide the required access and click on the ‘Save’ button. You’ll be navigated to below screen.Other-Settings
12. In the above screen, you can see the sharing rule which is created in the above steps.

Salesforce doesn’t allow the creation of sharing rules on all objects. Below table shows the objects on which sharing rules are allowed:

Salesforce Edition Objects
Professional Account, asset, contact and Record types
Enterprise Account territory, case, lead, opportunity, order, Campaign, Record types, and custom object sharing rules
Performance Account territory, case, lead, opportunity, order, Campaign, Record types, and custom object sharing rules
Unlimited Account territory, case, lead, opportunity, order, Campaign, Record types, and custom object sharing rules
Developer Account territory, case, lead, opportunity, order, Campaign, Record types, and custom object sharing rules

Limitations:

  • Sharing rules are only used to grant wider access to data.
  • The user can access related records automatically with sharing rules.
  • Sharing rules are applied to all users, irrespective of their status ie. Active or Inactive.
  • Sharing rules are reevaluated every time there is a change in users of the role/group or territory
  • As high-volume portal users don’t have roles, they can’t be included in Sharing Rules.
  • If a user has different levels of access to a record, the user will get the extended access to the record.

Now, you can easily integrate your Salesforce CRM with the back-end ERP system to automate the business process!Connect-Salesforce-ERP

You may also like:
Understanding Roles in Salesforce
How to Create Reports and Dashboards in Salesforce
Top 16 Salesforce AppExchange Apps