When the organization-wide settings are set to Private or Public Read Only, sometimes, as per business need, we will have to share the record with other users apart from the record owner and users higher in the role hierarchy. OWD sets the restrictions, and additional mechanisms open up access. To provide this access, Salesforce provides a component known as Sharing Rules. With sharing rules, one can share records with users who don't have access to the records. Sharing rules allocate access to users in public groups, roles, or territories. They grant users who have no access, due to the OWD settings, additional access to the records. There are various ways a record can be shared. Let's discuss all of them one by one. One can navigate to the Sharing Settings screen and configure sharing rules.
While configuring record ownership-based rules, the user will need to select which records to be shared and which users these records need to be shared with. The owner can be Public Groups, Roles, Role and Subordinates, and Portal Users. The users to share with can be Roles, Roles and Subordinates, Public Groups, and Portal Users. These options are shown in the following screenshot:
For some of the objects such as account, we have the option to provide access to the related objects in this sharing rule (case and opportunity for the account object). The access level for the records that are shared needs to be provided in the sharing rule. This will include Read Only or Read/Write access.
Let's say that you want to share records owned by sales reps among other sales reps. The rule will be very simple, as shown in the following screenshot:
Criteria-based sharing rules allow the administrator to write rules to share records based on criteria. The criteria will be formula-based expressions (using AND or OR logic), which will use record fields. The interface to configure will look as shown in the following screenshot. The type will be criteria based instead of owner based. An example of using this type of rule can be, let's say, sharing all accounts with Field type as Customer directly with Roles as salesrep.
3.138.189.5