You need to sign in to do that
Don't have an account?

Select a Queue in Trigger for Case Assignment
Hey All,
I apologize if this has already been solved, but it is very difficult to search for since the term 'queue' is so frequent in other uses.
I have a trigger that is creating and assigning cases based off Opportunity action. However, I would like to be able to select and assign the case to a queue. Apex tells me that the SObject Queue is not supported ( [SELECT Id FROM Queue] ), and Queues have no entry in the User Table.
If I know that I want to assign the case to a queue called 'MyQueue', I would like to be able to code that in rather than hardcode the ID. This will ensure that the trigger will work in any org we place it in.
Any suggestions are appreciated!
-DH
You can query Queues in Apex. Use the following syntax:
Select SobjectType, QueueId, Id From QueueSobject
All Answers
You can query Queues in Apex. Use the following syntax:
Select SobjectType, QueueId, Id From QueueSobject
You're very welcome.