Sharing Rules Unit

Create Sharing Rules Unit in Salesforce - Learn Here

Hey there, since we have already talked about the sharing rule now let’s have a look at how to create these sharing rules. You can create sharing rules based on record owner or other criteria, or create sharing rules that allow unauthenticated guest users to access records. You can also create sharing rules based on group membership of user objects. You can define up to 300 sharing rules per object. This includes up to 50 condition-based or guest user-sharing rules, if available for the object. 

Owner-Based Sharing Rules

  • If you include public groups in your sharing rules, make sure the appropriate groups are created. 
  • From Setup, enter Sharing Settings in the Quick Find box, then select Sharing Settings. 
  • In the object's Sharing Rules related list, click New. 
  • Enter the label name and rule name. Label names are displayed in the user interface. A rule name is a unique name used in APIs and managed packages. 
  • Optionally enter a description of the sharing rule, up to 1,000 characters. 
  • Select Based on record owner as the rule type. 
  • Specifies the user record to share. For owned by, select a category from the first drop-down list and a group of users from the second drop-down list or lookup field. 
  • Specify who can access the data. Under Share with, select a category from the first drop-down list and select a group of users from the second drop-down list or lookup field. 
  • Select shared access settings for the user. Some access settings are not available for some objects or in some situations. For this, you can use these access settings- 

              Private, Read Only, Read/Write, Full Access. 

  • Click save. 

dont miss out iconDon't forget to check out: Sharing Rules In Salesforce Security

Criteria-Based Sharing Rules

Criteria-based sharing rules determine who a record is shared with based on field values. 

  • To include public groups in sharing rules, make sure these groups are created. 
  • From Setup, enter Sharing Settings in the Quick Find box, then select Sharing Settings. 
  • In the object's Sharing Rules related list, click New. 
  • Enter the label name and rule name. Label names are displayed in the user interface. A rule name is a unique name used in APIs and managed packages. 
  • Optionally enter a description of the sharing rule, up to 1,000 characters. 
  • Select Criteria-based as the rule type. 
  • Specifies the field, operator, and value criteria that records must meet to be included in the sharing rule. The available fields depend on the selected object and the values are always literal numbers or strings. Click Add Filter Logic to change the AND relationship between filters. The value criteria is limited to 240 characters, and strings or picklist values that exceed this limit are truncated. 
  • If available, choose whether to include records owned by users who cannot be assigned an assigned role. B. Large numbers of users and system users. This setting is enabled by default and cannot be edited after saving the rule. 
  • Specify who can access the data. Under Share with, select a category from the first drop-down list and select a group of users from the second drop-down list or lookup field. 
  • Select shared access settings for the user. Some access settings are not available for some objects or in some situations. 

               Private, Read Only, Read/Write, Full Access. 

  • Save it. 

dont miss out iconCheck out another amazing blog by Akash here: Overview of Sharing Rules in Salesforce | Salesforce Security Guide

Points to Remember Here

  •  You can use fields that aren't supported in conditional sharing rules. Create a workflow rule or Apex trigger to copy field values to text or number fields. Then use this field as a reference. 
  • To include these users in criteria-based sharing rules created prior to Spring `22, delete the rule and select Include records owned by users who cannot be assigned roles when creating from scratch. To do. 
  • Access to contacts is not available when the organization-wide default for contacts is set to Parent-controlled. 

 

Responses

Popular Salesforce Blogs