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
Prosenjit Sarkar 7Prosenjit Sarkar 7 

Getting Available Obejcts from a queue.

Recently Salesforce has enabled a feature to assign supported objects to a custom queue. I need to get the names (or API) of those supported objects from a queue Id through Apex and SOQL or Meta data. Any body had idea about that ? 
Best Answer chosen by Prosenjit Sarkar 7
RAM AnisettiRAM Anisetti
Hi Prosenjit,

Please try to execute below query....!

List<Group>records=[SELECT Id,name,(select SobjectType from QueueSobjects) FROM Group where type='Queue'];

To Get all Objects which are in Queue
for(QueueSobjects qs:records.QueueSobjects){

    System.debug('all Sobjects----'+qs.SobjectType);

}

All Answers

NagaNaga (Salesforce Developers) 
Hi Prosenjit,

Please check if the below code will help

String queueName='Marketing Queue'; String queuesObjectType='Lead'; Id queueID = [Select Id from QueueSobject q where q.Queue.Name =:queueName q.SobjectType:=queueSObjectType]; List<id> queueGroupIDs=[Select Id FROM Group WHERE RelatedID IN :queueId]; List<id> queueUserIds=[Select UserOrGroupId FROM GroupMember WHERE GroupId IN :queueGroupIds];

Best Regards
Naga Kiran
RAM AnisettiRAM Anisetti
Hi Prosenjit,

Please try to execute below query....!

List<Group>records=[SELECT Id,name,(select SobjectType from QueueSobjects) FROM Group where type='Queue'];

To Get all Objects which are in Queue
for(QueueSobjects qs:records.QueueSobjects){

    System.debug('all Sobjects----'+qs.SobjectType);

}
This was selected as the best answer
Prosenjit Sarkar 7Prosenjit Sarkar 7
Hi RAM,
I got this solution by own before your reply and your answer is exactly the same what I asked for. Thank for you effort.

Thanks :)