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 retrieve User from a Queue

Hi All,



What i have Done is from GROUP object i retrieved records

List<Group> lstGroup = [select id,Type,Email,OwnerId,DoesSendEmailToMembers fromGroupwhere Type='Queue' and id='1234xxx']


Now from GroupMember Object retrived based on GroupID

list<GroupMember> lstGroupMember=[Select Id,UserOrGroupId, Group.NamefromGroupMemberwhere GroupId=:lstGroup [0].id];  


Now i need to retrive the user from that group.Any Thoughts




You are already on the track...

In the second query you will get the userorgroupid, that is all you need. if the userorgroupid starts with 005 then that is the user id . query the user object with the userids and all info you can get there.

Thanks for your reply.From second query i am getting group id.I need to retrieve user from the group.Any Idea?