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
Sridhar VenkateswaraluSridhar Venkateswaralu 

Fetch the Queue Name not Queue Label : Qsobject

Hi all,

I am facing an issue in retrieving queue name by querying the QSObject.

 

List<QueueSobject> lstQueueName = [Select Id, SobjectType, QueueId,Queue.Name from QueueSobject where SobjectType = 'Case' AND QueueId =: '00G30000002conp'];
system.debug(lstQueueName[0].queue.Name+'---');

 

The above query returns me the Queue Label but wat i need is the Queue name as u can see on the UI when u open any Queue.

 

Waiting for a quick reply,

Thanks,
Sridhar

 

Best Answer chosen by Admin (Salesforce Developers) 
VasanthKumarVasanthKumar

Sridhar,

 

Please maek the query like this,

 

List<Group> lstQueueRecords = [Select Id, Name, DeveloperName, Type from Group where Type = 'Queue'];

 

Here, you can fetch the list of all Queue records where,

 

the Name contains Queue Label and DeveloperName contians Queue Name. 

 

Hope this information might be useful.

All Answers

VasanthKumarVasanthKumar

Sridhar,

 

Please maek the query like this,

 

List<Group> lstQueueRecords = [Select Id, Name, DeveloperName, Type from Group where Type = 'Queue'];

 

Here, you can fetch the list of all Queue records where,

 

the Name contains Queue Label and DeveloperName contians Queue Name. 

 

Hope this information might be useful.

This was selected as the best answer
Kayla BorgKayla Borg

Hopefully I'm not being too presumptuous, but I think your original question may have been misunderstood, and what you're actually looking for is this:

"Queueid" is different from "Queue.id" - based on the rest of your query, it appears that you are looking for the latter, and putting a period between the two words would resolve your issue.

Brad BarrowesBrad Barrowes
Vasanth, I looked around for this answer for a while, and you had the right answer.  Thanks for the help.  Brad