Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Workflow to Auto populate the Lookup field

Posted on by Microsoft Employee

Hi Folks ,

    I am using CRM 2013 , I have entities called Events, Leads and Members . In the Event entity i have lookup fields for leads and Members. Now the problem is when i enter the email address in Event Entity . the lead lookup field or Member lookup field should Auto populate  once the email address match with lead record Email Address or Member Email Address .For this Scenario i created a workflow , but it is not working 

Here is the conditions of workflow 

  If Event  (Email Address) equals to  Lead (Email Address), then

  Update  Event  Lead field with {lead(event)}

Other Wise  If Event (Email Address ) equals to Member (Email Address), then 

Update  Event   Member Field with {lead(member)}

Can Anyone help me to achieve this so i can track all the activities and events occurred for each record in Lead and Member 

Thanks In Advance,

*This post is locked for comments

  • Arpit Shrivastava Profile Picture
    Arpit Shrivastava 7,518 User Group Leader on at
    RE: Workflow to Auto populate the Lookup field

    OOPS, I didn't check you are using CRM 2013. I have correctednow, You can use Odata then in case.

    Thanks Ramesh.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Workflow to Auto populate the Lookup field

    Hi Arpit, 

      As per my knowledge Web API is introduced in MS CRM 2016

  • Suggested answer
    Arpit Shrivastava Profile Picture
    Arpit Shrivastava 7,518 User Group Leader on at
    RE: Workflow to Auto populate the Lookup field

    Hi Raja,

    This can not be achieved through System Workflow. Because you will have to perform a query to pull the Lead and Member record of same email address given on Event record.

    You need to write either Plugin or Custom Workflow or Odata on the creation of 'Event' entity to achieve the same.

    Recommended way - Write OData Query on save of Event record.

    Pshedu code -

    On save of event record.

    var eventEmail = Get email address from event record.

    Var leadRecordCount = Fetch lead record where email address = eventEmail ; (using OData)

    Var memberRecordCount = Fetch member record where email address = eventEmail ; (using OData)

    if(leadRecordCount  > 1 | | memberRecordCount > 1)

    {

    alert('Mutiple Leads or Member records found of same email address');

    }

    else

    {

    Set the value in Lead and Member Lookup.

    }

    Can have a look below link for more detail about OData API.

    https://community.dynamics.com/crm/b/crmandunifiedservicedesk/archive/2017/04/13/javascript-odata-query

    Mark this as an answer, If you are able to get the solution.

    Cheers

    Arpit

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans