Create Criteria-Based Sharing Rules
A criteria-based sharing rule determines who to share records with based on field
values.
Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience |
Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions |
User Permissions Needed | |
---|---|
To create sharing rules: | Manage Sharing |
For example, you have a custom object for job applications, with a custom picklist field named “Department.” You create a criteria-based sharing rule to share all job applications in which the Department field is set to “IT” with all IT managers in your organization.
- To include public groups in your sharing rule, confirm that those groups were created.
- From Setup, in the Quick Find box, enter Sharing Settings, and then select Sharing Settings.
- In the Sharing Rules related list for the object, click New.
- 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.
- Optionally, enter a description of the sharing rule of up to 1,000 characters.
- For the rule type, select Based on criteria.
-
Specify the field, operator, and value criteria that records must match to be included in
the sharing rule. The fields available depend on the object selected, and the value is always a
literal number or string. To change the AND relationship between filters, click Add
Filter Logic. The value criteria is limited to 240 characters, and strings or
picklist values that go beyond this limit are truncated.
-
If available, select whether to include records owned by users who can’t have an assigned
role, such as high-volume users and system users. This setting is enabled by default and can’t
be edited after you save the rule.
-
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.
See Sharing Rule Categories for information on these categories.
-
Select sharing access settings for users. Some access settings aren’t available for some
objects or in some situations.
- Save your work.
After updates to sharing rules, sharing rules are recalculated to add or remove access as
needed. Depending on the nature of your updates and your org’s setup, these sharing calculations
can take a while to complete. If you experience sharing evaluations or timeouts, consider
deferring sharing calculations before making large-scale updates, and then restart and
recalculate sharing at a later time. For more information, see Defer Sharing
Calculations in Salesforce Help.