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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Update workerid via C# code

(0) ShareShare
ReportReport
Posted on by

We are using CRM Dynamics 2015 update1 (Carina) online. I have C# code that uses an existing queueItem and calls RouteToRequest to move it to a different queue.

The workerId field (which starts out with a value in the existing queueItem) ends up being empty and there does not appear to be a way to set it with RouteToRequest.

So I added code in to update the workerId via calling the PickFromQueueRequest with an execute call.

This errors out with “You are not allowed to pick.” and a stack trace. It does not say anything about security being an issue in the stack trace.

 

I did locate a Microsoft example of how to update the workedId with the PickFromQueueRequest and it didn’t have anything unexpected in it compared to my code.

 

Any ideas on why this fails?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Royal King Profile Picture
    27,686 on at

    Did you try with UpdateRequest to update the workedBy value?

    here is the code that worked forme to updated workerid in the queue item

    var updateReq = new Entity("queueitem");
    updateReq.Attributes["queueitemid"] = new Guid("{84B7D452-2845-E511-80F0-00155D016001}");
    updateReq.Attributes["workerid"] = new EntityReference("systemuser", new Guid("{784D6F09-A20E-E411-80BA-00155D01A00C}"));
    service.Update(updateReq);

  • Verified answer
    Community Member Profile Picture
    on at

    Thank you for the answer! The problem turns out to be that the destination queue was set to private and not defined as public as it should have been.

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ZS-27011425-0 Profile Picture

ZS-27011425-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans