web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to retrieve and check the queue item 'Worked By' field contains the value or not? from the subgrid level

(0) ShareShare
ReportReport
Posted on by 77

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
}
);
}
}
}
}

I have the same question (0)
  • Verified answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Try below code to retrieve worked by value -

    Xrm.WebApi.online.retrieveRecord("queueitem", "123", "?$select=title,_workerid_value").then(

       function success(result) {

           var title = result["title"];

           var _workerid_value = result["_workerid_value"];

          if(_workerid_value !=null || _workerid_value !='' || _workerid_value !=undefined)

    {

    _workerid_value =_workerid_value .replace('{','').replace('}','');

    }

       },

       function(error) {

           Xrm.Utility.alertDialog(error.message);

       }

    );

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • D365Admin Profile Picture
    77 on at

    Hi Bipin Kumar ,

    Thank you for your time in providing the solution to my query. It is working as expected. Thanks again!!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 72 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 29 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans