Managing Salesforce queues is typically restricted to system administrators, which often creates operational slowdowns for teams that need faster control over their assignments. When non-admin users must rely on admins for routine queue updates, productivity drops, and simple changes turn into avoidable delays.
In this blog, we’ll walk through a practical workaround to this limitation by building a secure, custom Salesforce application using Lightning Web Components (LWC), Apex, and Custom Metadata. This approach enables authorized non-admin users to add or remove queue members safely.
Prerequisite:
- Salesforce Developer account with admin access.
- Good hands-on Knowledge of JavaScript, HTML, LWC, Apex classes, permission sets, and metadata.
Below is the final interface of the application after implementation.
Step 1: Create a Custom Metadata Type to Define Which Queues Non-Admin Users Can Manage
- Create a metadata record for each non-admin user who can manage queues, using their email address. Each user should have one metadata record.
- In the custom metadata, we will create three fields.
- userEmail – Email of that non-admin user who will manage queues
- Queue List – Contains the names of the queues that this non-admin user can access.
- Queue User Role – Contains the role names that this non-admin user is allowed to access.
Step 2: Create a Lightning Web Component to provide an interface for users to access this functionality.
In this step, we build the LWC that serves as the main user interface for queue management. This component will read the custom metadata to determine which queues a non-admin user can manage, retrieve the list of available members based on the allowed roles, and display everything in a clean, interactive layout. From the UI, users can view existing queue members, add new members, or remove existing ones with a single click.
The LWC will call an Apex controller to handle all server-side operations securely, ensuring that only authorized users, based on the metadata configuration, can modify queue membership. This component essentially becomes the bridge between Salesforce data and a simplified, user-friendly queue management experience.
- Create an LWC with three files, queueManager.html, queueManager.js, and queueManager.js-meta.xml, along with an Apex controller class named QueueManagerService.cls.
- QueueManagerService.cls should be declared as without sharing so Salesforce can bypass object and field-level security checks, allowing non-admin users to manage queue members.
- In this code, users already assigned to the queue should always appear at the top, sorted by name.
- We will create a simple HTML file that includes a dropdown to select a queue, an option to choose the member type, a search bar for filtering members, and a list displaying the available members.
- In the XML file, we should enable lightning__AppPage, lightning__RecordPage, lightning__HomePage, and lightning__Tab because these targets allow the component to be used across different areas of Salesforce, such as app pages, record pages, the home page, and custom tabs.
In the JavaScript file, we will handle all the UI logic, call the Apex methods, and perform the necessary actions required for this application.
Step 3: Create a new permission set to grant access to the Apex class and LWC, ensuring that only authorized non-admin users can manage queues.
- The permission set should include all required permissions for the Apex class, the LWC, the custom tab, and the application.
Watch the Demo
Conclusion:
By building this custom queue management application using LWC, Apex, and custom metadata, we extended Salesforce’s native capabilities and made queue administration accessible to non-admin users in a secure and controlled way. This solution removes unnecessary dependency on system administrators while still maintaining full governance through metadata and permission sets.
With a simple and intuitive interface, users can now view, add, and remove queue members effortlessly. This implementation highlights the real value of tailored Salesforce development services, combining declarative tools with custom development to streamline operations, improve agility, and adapt Salesforce to real business needs.
No Data Found.
Share This Blog
Table of contents
- Step 1: Create a Custom Metadata Type to Define Which Queues Non-Admin Users Can Manage
- Step 2: Create a Lightning Web Component to provide an interface for users to access this functionality.
- Step 3: Create a new permission set to grant access to the Apex class and LWC, ensuring that only authorized non-admin users can manage queues.
- Watch the Demo
- Conclusion: