function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kvm1231kvm1231 

How to add users dynamically into public groups?

Hi,
Can you please let me know, how i can add users dynamically into Public Groups, when user select the specific record type and please find the below information

Requirement:
object -opportunity
Recordtypes- drafting
                    - nondrafting once the non drafting user login to salesforce ,they should not view the drafting records, so need to restrict the recordtypes. solution. we can restrict the record types based on the sharing rules (create group), but once any new user enter to the drafting we need to add that user to the group

Thanks in advance

KVM
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi,
Adding User to Public Group Please refer the below link for reference. hope it will be helpful.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar