function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi guys,
Does anyone have a sample code to automatically add all NEW users to a specific Public Group?
Thank you!:)
You'll need to:
create a new GroupMember object
set the GroupId to your group id
set the UserOrGroupId to the user id
insert into the database (or store in a list for later insertion if there are a few of them, to avoid governor limit probs).
Hi sai.sf,
Thank you but I have already checked @bob_buzzard answer that you are sending now. My situation is different that the other one.
I would like the NEW user to be added to group automatically once I click on save
.
That's what his description does.
Create a trigger for "after insert" of user records, and do the steps he outlined.
ok, will try that! thank you!
You'll need to:
create a new GroupMember object
set the GroupId to your group id
set the UserOrGroupId to the user id
insert into the database (or store in a list for later insertion if there are a few of them, to avoid governor limit probs).
All Answers
You'll need to:
create a new GroupMember object
set the GroupId to your group id
set the UserOrGroupId to the user id
insert into the database (or store in a list for later insertion if there are a few of them, to avoid governor limit probs).
Hi sai.sf,
Thank you but I have already checked @bob_buzzard answer that you are sending now. My situation is different that the other one.
I would like the NEW user to be added to group automatically once I click on save
.
That's what his description does.
Create a trigger for "after insert" of user records, and do the steps he outlined.
ok, will try that! thank you!