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

How to add users dynamically into public groups?

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

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

Rahul KumarRahul Kumar (Salesforce Developers) 
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 that question is removed from an unanswered question and appear as a proper solution.

Rahul Kumar