<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">public class QueueMembersController {

    // selected queue whose members to view
    public ID queueId { get; set; }

    // provide queue name to show on page
    public Group selectedQueue {
        get {
            return [
                SELECT
                    id, name
                FROM
                    Group
                WHERE
                    id = :queueId
            ];
        }
    }

    // list of all active queue members
    public List&lt;User&gt; queueMembers {
        get {
            return [
                SELECT
                    id, firstName, lastName, alias, username, email, userRole.name, profile.name
                FROM
                    User
                WHERE
                    id IN ( SELECT userOrGroupId FROM GroupMember WHERE groupId = :queueId )
                    AND
                    isActive = true
            ];
        }
    }

    /**
     * Controller
     */
    public QueueMembersController() {
        queueId = ApexPages.currentPage().getParameters().get('queueId');
    }

    public PageReference refresh() {
        return null;
    }

    // picklist of queues whose members to view
    public List&lt;SelectOption&gt; getQueueOptions() {

        List&lt;SelectOption&gt; options = new List&lt;SelectOption&gt;();

        options.add( new SelectOption( '', '- Select -' ) );
        for ( Group grp : [
            SELECT
                id, name
            FROM
                Group
            WHERE
                type = 'Queue'
           ORDER BY
               name
        ] ) {
            options.add( new SelectOption( grp.id, grp.name ) );
        }

        return options;
    }

}</pre></body></html>