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
Surabhi AgrawalSurabhi Agrawal 

how to write trigger for updating custom field in user object when members added to a queue of particular Sobject

Best Answer chosen by Surabhi Agrawal
logontokartiklogontokartik
I dont think its possible today, When a user is added to the Queue, a record is created in GroupMember object, and we cannot write a trigger on GroupMember object today. 

Alternative soln, is periodically check if the members are added to group by doing a SOQL and then based on that update the custom field. You can use scheduled job to do this.


All Answers

bob_buzzardbob_buzzard
You don't have the ability to trigger processing when a user is added to a queue - there is no event for you to hook into.
logontokartiklogontokartik
I dont think its possible today, When a user is added to the Queue, a record is created in GroupMember object, and we cannot write a trigger on GroupMember object today. 

Alternative soln, is periodically check if the members are added to group by doing a SOQL and then based on that update the custom field. You can use scheduled job to do this.


This was selected as the best answer
Surabhi AgrawalSurabhi Agrawal
Thanks guys!