Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

SelectedControlSelectedItemIds not working correctly on Ribbon workbench - with Unified Interface - Queue Item

Posted on by 190

We are passing the parameter SelectedControlSelectedItemIds to a JavaScript function from a custom ribbon button. We are using this to pick queue items from a queue. The Pick button is not the OOB button, it is a custom Pick button. The parameter correctly provides the GUID of the entity record (Email or Case) held in the queue item in the old legacy interface but when we use the same parameter in the new Unified Interface the same paramater returns the GUID of the queue item record instead of the case or email that is stored within the queue item. We have justr discovered this while testing the new interface.

Any advice appreciated. I have tried all the other parameters available on the ribbon workbench but none bring back the GUID I need.

Thanks

Phil

  • Verified answer
    fillcrocker Profile Picture
    fillcrocker 190 on at
    RE: SelectedControlSelectedItemIds not working correctly on Ribbon workbench - with Unified Interface - Queue Item

    I used this function to retrieve the GUID of the related record wrapped in the queue item record (not sure that is correct term)

    selectedControlItemId is the queue item GUID

    queuItemId is the returned GUID of the related record

    I used Jason Latimer's CRM REST builder as it was a bit tricky to get the related record from the queue item record

    var getRelatedQueuItemRecordId = function (selectedControlItemId) {
        
        var urlString = "/api/data/v9.1/queueitems(" + selectedControlItemId.toString() + ")?$select=_objectid_value,objecttypecode,_queueid_value,queueitemid"
        var req = new XMLHttpRequest();
        var queueItemId = null;
        var _objectid_value_lookuplogicalname = "";
        var req = new XMLHttpRequest();
        req.open("GET", Xrm.Page.context.getClientUrl() + urlString, false);
        req.setRequestHeader("OData-MaxVersion", "4.0");
        req.setRequestHeader("OData-Version", "4.0");
        req.setRequestHeader("Accept", "application/json");
        req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
        req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
        req.onreadystatechange = function() {
        if (this.readyState === 4) {
            req.onreadystatechange = null;
            if (this.status === 200) {
                var result = JSON.parse(this.response);
                var _objectid_value = result["_objectid_value"];
                queueItemId = _objectid_value;
                
            } else {
                Xrm.Utility.alertDialog(this.statusText);
            }
        }   
    };
    req.send();
    return queueItemId;
    };

  • Ics_rthompsoneu Profile Picture
    Ics_rthompsoneu 70 on at
    RE: SelectedControlSelectedItemIds not working correctly on Ribbon workbench - with Unified Interface - Queue Item

    If you can.  Please post the example of what you did to resolve your issue.

    Thanks

  • Suggested answer
    fillcrocker Profile Picture
    fillcrocker 190 on at
    RE: SelectedControlSelectedItemIds not working correctly on Ribbon workbench - with Unified Interface - Queue Item

    Hi Henry,

    Thanks for the reply and suggestion. I was able to get what I needed by using the queue item GUID as you suggested.

    Phil

  • Verified answer
    Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: SelectedControlSelectedItemIds not working correctly on Ribbon workbench - with Unified Interface - Queue Item

    Hi Phil,

    I wasn't aware of that change of behavior.
    Can you try from the Queue GUID to retrieve the related record's entity type and GUID? You might be able to achieve your goal that way.

    Can you open a Support Request to check if this is by design (some behaviors have changed on purpose in the Unified Interface) or if it's a bug?
    https://admin.powerplatform.microsoft.com/support

    Henry

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

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans