Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Automatically update lookup

Posted on by 420

I have a State lookup and when I select it, I want my Country Lookup to update. Right now I'm doing it with a workflow and a Save through javascript to display it instantly but it's pretty slow(~1 second). Is there any faster way to do this? My State entity has a reference to Country by the way. Thanks

*This post is locked for comments

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Automatically update lookup

    I understood your question properly. May be my explanation was not clear. I will try to do my best.

    If you want to populate field you can write JavaScript that will handle change of your state field, retrieve country from state (you can use tool I mentioned in my previous reply to build query and initial version of script) and populate country field. Example how to populate lookups you can find here - neilparkhurst.com/.../javascript-set-lookup-details

  • Suggested answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: Automatically update lookup

    If this is only required on form then you can use 'quick view form' of 'State' and add only lookup of 'country' in that form.

    This will make country appear whenever you change State lookup.

  • anonsgate Profile Picture
    anonsgate 420 on at
    RE: Automatically update lookup

    Maybe my question isn't clear.

    Here's an example :

    State entity has the values  state:New Jersey countryid:1

    Country entity has values United States(id 1),Canada(id 2)

    I have two lookup fields. When I select New Jersey in my first lookup, I want the second lookup to update to United States. Without having to save or refresh the page. Is that possible?

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Automatically update lookup

    Hello,

    You can use CRM Endpoints to retrieve that data and populate lookup of country.

    You can use CRMRestBuilder tool to build request and get initial version of your script - github.com/.../2.5.0.0

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