Hi,
I have a question which I hope someone can shed some light. Thanks in advance
Using JavaScript function, I want to retrieve the selected record queue item and checks for the Worked By of the queue item to see if it is already populated or not? Based on the outcome, I want to do further steps. But I stuck at checking the Worked By value. I am passing the Selected item to the function and retrieved the queue item title using the Xrm.WebApi.retrieveRecord method. But I am struggling at retrieving the Worked By value or check if it is null or not. Please suggest. Thanks
function GetWorkerIdValue(selectedItems)
{
if (selectedItems != null && selectedItems.length > 0)
{
// alert("selectedItems.length - "+selectedItems.length);
var queueItemId = null;
for (var indxIds = 0; indxIds < selectedItems.length; indxIds++)
{
queueItemId = selectedItems[indxIds].Id;
if (queueItemId != null)
{
Xrm.WebApi.retrieveRecord("queueitem", queueItemId, "?$select=title,_workerid_value").then(
function success(result) {
var title = result.title;
//var workerId = result._workerid_value;
// perform operations on record retrieval
},
function (error) {
alert(error.message);
// handle error conditions
}
);
}
}
}
}