Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

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

(0) ShareShare
ReportReport
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 72 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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans