Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How Set values of State, Country, PinCode based on City using JavaScript

Posted on by 255

I have tried bt its not working.

*This post is locked for comments

  • Emre GULCAN Profile Picture
    Emre GULCAN 2,379 on at
    RE: How Set values of State, Country, PinCode based on City using JavaScript

    Hi Anant,

    You can easly do it by javascript/jQuery AJAX call with oData query.

    Your oData query is something like that

    YOUR_CRM/xrmservices/2011/OrganizationData.svc/new_citySet?$select=new_country,new_pincode&$filter=new_cityId eq guid'YOUR CITY UNIQUEIDENTIFIER'


    If you're not similar with oData you can use oData query designer tools / solutions like https://github.com/jlattimer/CRMRESTBuilder 

  • Verified answer
    Anant Profile Picture
    Anant 255 on at
    RE: How Set values of State, Country, PinCode based on City using JavaScript

    i have data stored in the CRM.

    if city name is unique(the lookup field can not have duplicate records), then we can set the state as well as country also based on the pincode value.

  • prt33k Profile Picture
    prt33k 6,907 on at
    RE: How Set values of State, Country, PinCode based on City using JavaScript

    Hi Anant,

    Are you using 3rd party API like Bing, Yahoo, Google or you have data stored in CRM or XML?

    Also I dont understand how can u set Country based on City and same City name exist in multiple country.

    Thanks,

    PS

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How Set values of State, Country, PinCode based on City using JavaScript

    Share your code here

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