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
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;
};
If you can. Please post the example of what you did to resolve your issue.
Thanks
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
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156