I am looking for a way to control how many users are allowed in a queue. I have not seen any documentation or posts regarding this subject.
Is this even possible??.
Can there be a trigger fired when user is added to a queue.


2 Answers 2


No. Most "setup" objects, such as CustomObject, Queue, Profile, and UserRole cannot have triggers created for them. The main exception to this is the User object, which can have triggers defined. If you're every not sure about a particular object, you can always query the object by the API to get information about if triggers can be written for an object. See DescribeSObjectResult.


A Queue is a special Type of Group. The Group Type is a picklist value.

From the Object Reference: Groups are sets of users. They can contain individual users as well as other groups, the users in a particular role or territory, or the users in a particular role or territory plus all of the users below that role or territory in the hierarchy.

From the above, depending on how your Queue is defined, just creating a new User with a specific Role, could cause a user to be added to your Queue. I see nothing in the Object Reference that would allow you to limit the size of a Queue or Group.

Since the supported calls for Group are create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), search(), retrieve(), update() and upsert(), it would at first appear as though one could write a trigger on Group to detect when a new user has been added to your queue. However, as per the answer posted by @sfdcfox, upon checking the DescribeSObjectResult for Group, using Workbench Group does not show as being triggerable.

  • Thanks for the response and explanation. I have just started working in salesforce. If a trigger is allowed on the Group object, why would it not allow restricting users via "before insert" trigger.
    – venky
    Apr 27, 2015 at 0:57
  • See my edited answer. Even if it had been triggerable, if users were being added to your Org and therefore to your Queue using Roles, (don't know how your Queue is defined), you'd have had an issue enforcing the limit. I suspect the "control issue" is with delegated admins if you're adding users to the Queue on a user by user basis. I'd recommend you look to see how it's defined.
    – crmprogdev
    Apr 27, 2015 at 21:00
  • Thanks, also in developer console, when creating a new trigger, group or QueueSObject are not in the list of objects that can be selected.
    – venky
    Apr 28, 2015 at 2:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .