Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Fetch lookup value and set it to another lookup field on differnt form

Posted on by 335

Hello there,

I have simple requirement, on button click event i want to fetch lookup field select value which is on lead form and set it to another lookup field which has on contact form

using javascript.and that contact form will be opened as new record.

1.Click of button(Lead form)

1261.button.PNG

2.source value(lookup field selected)(Lead form)

6242.source.PNG

3.set that value here(lookupfield))(Contact form)

2500.target.PNG

both has different entities.

Thanks,

Regaards.

*This post is locked for comments

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Fetch lookup value and set it to another lookup field on differnt form

    Create New Workflow on Lead Entity

    Set it to Start when Record Status Changes

    In the Designer set it to:

    If Lead -> Status == Disqualified

    Update Customer (Contact)

    --> Properties: Company Name = Customer (Account)

    See if that works for you.

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Fetch lookup value and set it to another lookup field on differnt form

    You will get all information from below link:

    community.dynamics.com/.../crm-2015-javascript-opening-an-entity-form-from-javascript

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Fetch lookup value and set it to another lookup field on differnt form

    Hi Yash Trivedi,

    You can achieve this functionality using ribbon customization.

    1. Customize 'DISQUALIFY' button and add js inside action. Refer following url for reference:

    pravinpawarweb.wordpress.com/.../validate-standard-out-of-box-button-using-custom-javascript-function

    2. Using Js open new form (contact) using Xrm.Utility.openEntityForm and pass lookup parameter while opening new entity form. Please refer following url for reference:

    community.dynamics.com/.../xrm-utility-openentityform-with-parameters

  • Yash Trivedi CRM Profile Picture
    Yash Trivedi CRM 335 on at
    RE: Fetch lookup value and set it to another lookup field on differnt form

    Hy aric,

    can you guid how can i capture the account on the lead and set it to the account on the contact entity,it will be very helpfull.

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Fetch lookup value and set it to another lookup field on differnt form

    Per your question, this might be simpler than expected. You are disqualifying a record.

    You can create a workflow on the change status event on the lead.

    Capture the account on the lead and set it to the account on the contact entity.

    Should be pretty straight forward.

    Hope this helps.

  • Suggested answer
    Sreevalli Profile Picture
    Sreevalli 3,256 on at
    RE: Fetch lookup value and set it to another lookup field on differnt form

    Hi Yash,

    hope you have connection between the contact (on which you are trying to populate Account). if so, you can just create a workflow on lead status(= Disqualify) then update Contact (I assume its "Existing Contact") with lead account.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Fetch lookup value and set it to another lookup field on differnt form

    Presuming you know the id of this Lead, can you not just make xrm.webapi call from the contact onload?

    [View:https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-webapi/retrieverecord]

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