Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

how can i get the related contacts on the lookup field when i choose an existing account in the lead entity?

Posted on by 255

there is a lead entity and the query is if we select an account from the lookup field , there the contact lookup field should also show the related contacts in the lookup field. 

*This post is locked for comments

  • Anant Profile Picture
    Anant 255 on at
    RE: how can i get the related contacts on the lookup field when i choose an existing account in the lead entity?

    thanks man..!! finally the code is working..

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: how can i get the related contacts on the lookup field when i choose an existing account in the lead entity?

    Hi Anant,

     I'm pretty sure this functionality is available out of the box, you just need to configure related records filtering for the contacts lookup on that form:

    www.powerobjects.com/.../how-to-use-dependent-lookups-for-dynamics-crm-201320152016

  • Verified answer
    Rajat Awasthi Profile Picture
    Rajat Awasthi 675 on at
    RE: how can i get the related contacts on the lookup field when i choose an existing account in the lead entity?

    Hi Anant ,

    You can write a java script to show desired records view.

    function preFilterLookup() {    Xrm.Page.getControl("parentaccountid").addPreSearch(function () {

        addLookupFilter();

      });

    }

    function addLookupFilter() {

       var email = Xrm.Page.getAttribute("emailaddress1").getValue();

       if (email != null) {

           fetchXml = "<filter type='and'><condition attribute='emailaddress1' operator='eq' value='" + email + "' /></filter>";            Xrm.Page.getControl("parentaccountid").addCustomFilter(fetchXml);

       }

    }

    Please mark as verified if this has helped you.

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,397 on at
    RE: how can i get the related contacts on the lookup field when i choose an existing account in the lead entity?

    Hi

    You need to create custom filtered lookup

    community.dynamics.com/.../159418

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans