A public group can be defined as a collection of individual users, other groups, individual roles, and/or roles with their subordinates that all have a function in common.
Why do we Use or Create Public Groups in Salesforce?
- Public groups in Salesforce are used to define sharing rules.
- Public groups help us to place different Users, Roles, Roles and Subordinates and even public groups together so that we can apply sharing rules to all of them required accordingly.
- Using a public group when defining a sharing rule makes the rule easier to create and, more important, easier to understand later, especially if it's one of many sharing rules that you're trying to maintain in a large organization.
- Public groups are used to extend sharing rules beyond Role Hierarchies in Salesforce.
Don't forget to check out: Salesforce Public Groups and Queues
How to Create Public Groups?
Steps to follow to create a public group:
1. First, log in to your Salesforce org.
2. Go to setup.
3. In the setup, go to Administration, then select Users and under users, you can find Public Groups.
4. Or you can find Public Groups directly by searching Public Groups in the Quick Find Box.
5. Click on Public groups and click on the New button.
6. First Enter Label. The group name will auto-populate.
Check out another amazing blog by Sejal here: Best Practices for Salesforce Lightning Web Components (LWC)
7. Check Grant Access using Hierarchies, if you want to share the access according to role hierarchies.
8. If you don’t want to share the access on the basis of Role Hierarchies, then uncheck the Grant Access Using Hierarchies checkbox.
9. Then, according to your requirement, you can choose from Users, Roles, Roles and Subordinates and public groups in the Search Box and add to the Selected Delegated Groups.
10. Then click the Save button.
Now, you can use a public group for sharing rules.