Skip to main content
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Button/Javascript for changing queue

(0) ShareShare
ReportReport
Posted on by 15

Hello,

We have a small customer service group who changes between queues in the queue times views. In the unified interface, the default path when pressing the "Queue items" button is routing the user to it's own personal queue. Which is fine.

The issue is, we have a other queue in which the customer service agent needs to go to quite often. They could use the dropdown menu to change the queue, but it would be easier with a button on the ribbon. 

I tried to look through the documentation, however I am not skilled enough to write a javascript for this. Does anybody have a similar issue? How did you solve it?

Basically, I would like to have a button called "Servicedesk", and pressing this would change the queue to show "All items" in a specific queue.

  • Suggested answer
    Pankaj Gogoi Profile Picture
    3,177 on at
    RE: Button/Javascript for changing queue

    As suggested by Leo, on click of the button you can change the view id and provide the entity name as Queue instead of QueueItem

    yourorgname.crm.dynamics.com/main.aspx?appid=78e1a6df1-75be-ea11-a812-000d3a3e1799&forceUCI=1&pagetype=entitylist&etn=queue&viewid=8c415551-a9c2-ea11-a812-000d3a3e1af1&viewType=1039

    You should create new view and filter it by ServiceDesk Queue and provide this view id in the url. You can modify the sub area Queue url using the App Designer to load the QueueItem entity instead of Queue.

    Hope this helps.

  • Thorsortevik Profile Picture
    15 on at
    RE: Button/Javascript for changing queue

    Hello,

    Thank you. Many good pointers here.

    My intent is not to change the view, but only the queue. Does the combination of "View" and "Queue" have it's on URL? Because the URL does not change when I change queues in the queue item list view.

    For instance, I am handling 2 queues.

    My personal queue: Thor

    The servicedesk queue: Servicedesk

    When I press home, I get directed to "All items" in my personal queue. I want to click the button to change only the queue. So it changes to "All items" in "Servicedesk".

  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: Button/Javascript for changing queue

    Hi partner,

    Do you mean you want to add a button on the queue entity list page and when you click on this, D365 will change to another special view?

    If so, actually you should only add a new button on Queue Item list and when clicking on it, let the page direct to the URL for your special queue.

    Each view has its own URL, you could get the URL you need first, and then use it in you JS code.

    For example, when I show All Items in Support Queue, the URL is:https://OrgURL.crm.dynamics.com/main.aspx?appid=1102ae85-4d94-ea11-a811-000d3a192986&pagetype=entitylist&etn=queueitem&viewid=2d8d408d-c255-4587-9e34-596d496e6738&viewType=1039

    pastedimage1594346138070v1.png

    So after get this you should add a ribbon in ribbon workbench.

    pastedimage1594356710671v2.png

    Here's the code.

    function directQueue() {
        var pageInput = {
            pageType: "entitylist",
            entityName: "queue",
            viewId: "2d8d408d-c255-4587-9e34-596d496e6738",
    
        };
        var navigationOptions = {
            target: 1
    
        };
        Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
            function success() {
                // Run code on success
            },
            function error() {
                // Handle errors
            });
    }

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/navigateto

    Best Regards,

    Leo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#2
Ramesh Kumar Profile Picture

Ramesh Kumar 42

#3
David Shaw_UK Profile Picture

David Shaw_UK 27

Featured topics

Product updates

Dynamics 365 release plans