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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Custom workflow to assign Lead Record to other user.

(0) ShareShare
ReportReport
Posted on by 255

Hi Guyz,

I have a task that is based on the condition that: Lead record will  be assigned to the User who has same pin code as inserted on the Lead form. 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at
    RE: Custom workflow to assign Lead Record to other user.

    Hi Anant,

    You should first retrieve the user record with zip code same as that of the lead record using QueryExpression. You could use the following code to assign the record to the user.

    // Create the Request Object and Set the Request Object's Properties
    AssignRequest assign = new AssignRequest
    {
      Assignee = new EntityReference("systemuser", UserID),
      Target = new EntityReference("lead", LeadID)
    };
     
    // Execute the Request
    orgService.Execute(assign);

    Hope this helps.

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Custom workflow to assign Lead Record to other user.

    Hi Anant,

    If you are looking for sample code this could give you a good start, you need to modify code to get user based on their zip code: consultantabhishek.blogspot.in/.../round-robin-assignment-microsoft.html

    Let us know if you are facing any issue.

    thanks

  • RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Custom workflow to assign Lead Record to other user.

    Hi Anant,

    Are you facing any issues/ error?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#3
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans