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.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
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