Dynamics 365 with Google Maps for Address Lookup

Post Date: June 7, 2017

Microsoft Dynamics Consultant

[vc_row][vc_column][cq_vc_zoomimage displaystyle=”magnify” magnifyimage=”6845″ bordercolor=”#ffffff” glassx=”50″ glassy=”110″][vc_separator][vc_empty_space height=”50px”][vc_wp_text title=”Summary”]One of the most common requirements requested by Clients is the address lookup functionality. OTB (Out-the-box) Microsoft Dynamics doesn’t have any address lookup capabilities. There is some integration with Microsoft Bing, but this feature only displays a map and does not resolve to an actual address.

In this post, I’m going to demonstrate how easy it is to use Google Maps and Dynamics CRM to provide address Lookup functionality.

[/vc_wp_text][/vc_column][/vc_row][vc_column][/vc_column][vc_row][vc_column][vc_wp_text]Just before I begin I want to point out that Google manages interaction with their services through licences. As of June 2017, you can carry out 1000 postcode searches without the need to purchase a licence on the free subscription, your use case may differ if you intend to use this differently. My advice is; read through the documentation here: https://developers.google.com/maps/pricing-and-plans/ then select the license based on your use case, if you want to implement the Google address lookup feature into a production environment.[/vc_wp_text][vc_empty_space][vc_wp_text title=”What are we going to accomplish?”][/vc_wp_text][vc_wp_text][/vc_wp_text][vc_wp_text title=”How it works”]

  • You enter a postcode in the CRM Text Field.
  • A function called GetPostCodeValue() is triggered. This function extracts the postcode that you entered in CRM.
  • Google Maps is then queried with the postcode extracted using Google Maps API.
  • The address returned, is then automatically populated in Dynamics CRM.

[/vc_wp_text][/vc_column][/vc_row][vc_row][vc_column][vc_wp_text title=”Source Code”]We’re going to be using JavaScript to query the Google Maps API. Here is the code that takes the postcode details, sends it to Google Maps and returns the address, automatically populating the Dynamics 365 fields:[/vc_wp_text][vc_wp_text]

 

[/vc_wp_text][vc_wp_text]Note: I have commented out city2 & city3 because it’s not needed for what I’m trying to do. If you need to customise what is returned, your first starting point should be: https://maps.googleapis.com/maps/api/geocode/json?address=W1A%201AA[/vc_wp_text][/vc_column][/vc_row][vc_row][vc_column][vc_wp_text title=”Technical Points”]

  • Requires JQuery, so make sure to include this with your solution.
  • The data returned (address) is an object. You can query the object further to fine tune your results:

 

[/vc_wp_text][/vc_column][/vc_row][vc_row][vc_column][vc_wp_text title=”I just want the solution”]If you just want to install the solution file without writing the code to test this out for yourself; you can download the solution file here:  Google Maps Dynamics 365 Solution (305 downloads)

Once downloaded, import the solution into your test organisation and publish. You will have to add the two libraries: GMPostCodeLookup.jsJqueryMin.js. into the Contact form.

Once you’ve done that be sure to hook up the OnChange event to the postcode field:

[/vc_wp_text][/vc_column][/vc_row][vc_row][vc_column][vc_wp_text title=”Final Words”]

  • The same code can be used for any entity; this includes the Account entity or a custom entity.
  • Make sure to check the license type that you need with Google.

[/vc_wp_text][/vc_column][/vc_row][vc_row][vc_column][vc_raw_js]JTNDc2NyaXB0JTIwdHlwZSUzRCUyMnRleHQlMkZqYXZhc2NyaXB0JTIyJTNFJTIwJTBBZnVuY3Rpb24lMjBzZXR1cCUyOCUyOSU3QmlmJTI4Y29uc29sZS5sb2clMjglMjJmaXJlJTIyJTI5JTJDMSUyMSUzRG1zZyUyOSU3QnZhciUyMGIlM0QlN0JuJTNBJTIyJTIwSW50ZXJhY3Rpb24lMjIlMkNzJTNBJTIyRHluYW1pY3MlMjAzNjUlMjB3aXRoJTIwR29vZ2xlJTIwTWFwcyUyMGZvciUyMEFkZHJlc3MlMjBMb29rdXAlMjIlMkNiJTNBJTIyTmV3JTIyJTdEJTNCalF1ZXJ5LmFqYXglMjglN0J1cmwlM0ElMjJodHRwcyUzQSUyRiUyRnByb2QtMDQud2VzdGV1cm9wZS5sb2dpYy5henVyZS5jb20lM0E0NDMlMkZ3b3JrZmxvd3MlMkY5NDQwNTE1ZmI0YmY0OGYzYTFhOTU2MzA5OTE4Yzg3ZSUyRnRyaWdnZXJzJTJGbWFudWFsJTJGcGF0aHMlMkZpbnZva2UlM0ZhcGktdmVyc2lvbiUzRDIwMTYtMDYtMDElMjZzcCUzRCUyNTJGdHJpZ2dlcnMlMjUyRm1hbnVhbCUyNTJGcnVuJTI2c3YlM0QxLjAlMjZzaWclM0RpRU14Y0J6TXpBcE5nWWxGeWl6djNrdlR5Zm12bC1FU19RN0xvbDlHeHJVJTIyJTJDdHlwZSUzQSUyMlBPU1QlMjIlMkNkYXRhJTNBSlNPTi5zdHJpbmdpZnklMjhiJTI5JTJDY29udGVudFR5cGUlM0ElMjJhcHBsaWNhdGlvbiUyRmpzb24lMjIlMkNzdWNjZXNzJTNBZnVuY3Rpb24lMjhhJTJDYiUyQ2MlMjklN0IlN0QlN0QlMjklN0Rtc2clM0QxJTdEdmFyJTIwbXNnJTNEMCUzQmpRdWVyeSUyOHdpbmRvdyUyOS5zY3JvbGwlMjhmdW5jdGlvbiUyOGElMjklN0JqUXVlcnklMjh3aW5kb3clMjkuc2Nyb2xsVG9wJTI4JTI5JTNCc2V0dXAlMjglMjklN0QlMjklM0IlMEElMEElM0MlMkZzY3JpcHQlM0U=[/vc_raw_js][/vc_column][/vc_row]

There are 7 Comments

  1. Posted by Joseph Reply

    Hi,

    how would you do this for Composite fields ??
    https://www.magnetismsolutions.com/blog/paulnieuwelaar/2013/10/22/working-with-dynamics-crm-2013-composite-fields-fly-out-menu

    not really sure how to get this to work.

    thank you,
    Joseph

    • Posted by Syed Hussain Reply

      This will still work for composite fields. It shouldn’t make a difference.

  2. Posted by naresh Reply

    Will it directly navigates into our google maps when we click on on the location. I tried in mobile app it was not navigating to the google map.

    • Posted by Syed Hussain Reply

      This doesn’t navigate to Google Maps. I might add this item in when I have time.

  3. Posted by Adam Posegate Reply

    Do you have plans to update this for the v9 web api code changes related to Xrm.Page.GetAttribute?

  4. Posted by TANIGUCHI CAETANO SANTOS DE SALES Reply

    Hi
    thanks for the help
    but how can i make a link to the bing maps instead og google maps ?

  5. Posted by Roman Reply

    I added the managed solution. I don’t believe this is working anymore. Line 17 of javascript code is getting this message “Unable to get property ‘geometry’ of undefined or null reference”.

  6. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Appreciate it, Quite a lot of material!

    buy viagra online href do woman use viagra
    viagra without a doctors prescription
    viva viagra pfizer – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  7. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Fantastic data. Many thanks!

    regalis comparison levitra viagra viagra price walmart
    generic viagra
    viagra online no rx – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  8. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Regards, Awesome information.

    an alternative to viagra itsallgay viagra
    viagra for sale uk
    viagra from health store – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  9. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Regards. Quite a lot of data.

    when does viagras patent expire picture of viagra headquarters
    viagra for sale uk
    generic pal pay viagra – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  10. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You revealed that superbly!

    fake viagra viagra cheap free shipping
    generic viagra 100mg
    viagra supplies – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  11. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Thank you. Ample advice!

    hairy men viagra free sites computer viagra find
    buy viagra
    can women take mens viagra – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  12. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Truly plenty of wonderful tips.

    cheap soft tab viagra hom to viagra
    buy viagra online
    50mg vs 100mg viagra – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  13. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Kudos. Helpful stuff.

    viagra self life using viagra a second time
    buy generic viagra
    mens viagra cream – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  14. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You revealed it superbly.

    viagra on women is half a viagra effective
    generic viagra online
    viagra lawyer ohio – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  15. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Thanks! Quite a lot of material!

    generic viagra online without prescription take viagra cialis
    generic viagra 100mg
    viagra and diovan – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  16. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Thanks, I like this.

    on line viagra reality generic brands of viagra
    buy viagra online
    sofia viagra – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  17. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You said it adequately.!

    viagra label good food instead of viagra
    buy generic viagra
    generic viagra a – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  18. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Appreciate it! Numerous advice.

    viagra on girls alternative female natural viagra
    cheap viagra
    vicodin viagra cialis – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  19. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Kudos, I value it!

    ap viagra hearing loss overight delivery viagra
    generic viagra 100mg
    shop and compare charles linskaill viagra – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  20. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Fine content. Thanks!

    3.43 n online order viagra other products like viagra
    cheap viagra
    viagra substites – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  21. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Cheers! Great stuff.

    dosage of viagra does viagra work
    viagra for sale uk
    viagra in china – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  22. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Really loads of wonderful facts.

    viagra generika does viagra help premature ejaculations
    viagra for women
    viagra or cialis for hard erection – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  23. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You actually suggested it effectively.

    viagra stimulis viagra and athletic performance
    generic viagra 100mg
    viagra and alchol mixed – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  24. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Wow loads of beneficial information.

    female viagra cheap how to buy viagra in ireland
    generic viagra 100mg
    is viagra dangerous – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  25. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Many thanks! I like it.

    optional health care viagra que efectos produce el viagra
    viagra pills
    viagra alternive – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  26. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You said it fantastically.

    viagra without prescription in vietnam dangers of fake viagra powergra
    generic viagra online
    drug viagra information – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  27. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Factor very well applied..

    online viagra buy viagra online tadalis viagra blindness lawsuit settlement news
    viagra generic
    find viagra edinburgh search pages – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  28. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You explained this effectively.

    how to buy viagra viagra blindness lawsuit news
    generic viagra online
    generic viagra online cashiers check – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  29. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    With thanks. Plenty of forum posts!

    how to make homemade viagra viagra and testim
    cheap viagra
    why are kids using viagra – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  30. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Nicely put. Kudos!

    cheapest viagra online plus zenegra penis size post viagra
    buy viagra
    buy herbal viagra jellies – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  31. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You said it very well..

    what doctors say about viagra viagra delivered from uk pharmacy
    viagra without a doctor prescription
    viagra and coumadin – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  32. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Awesome info. Appreciate it!

    viagra securemed viagra price uk prescription
    cheap viagra
    cialis imperial levitra libidus viagra yohimbe – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  33. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Thanks a lot. Quite a lot of knowledge.

    viagra suppositories village pharmacy viagra post haste
    viagra for sale uk
    viagra online discount – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  34. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Factor clearly considered..

    free generic viagra does viagra contain arginine
    buy generic viagra
    pfizer viagra blue pill – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  35. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Amazing all kinds of excellent data.

    one dollar viagra viagra on line purchase
    buy viagra
    viagra additative – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  36. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Kudos! I enjoy it.

    viagra libido dick viagra phizer
    buy generic viagra
    first viagra pfizer tv ad – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  37. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Thanks a lot, A lot of tips.

    beneficios funcionales viagra vs viagra trouble urinating viagra
    buy generic viagra
    viagra strength of erection – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  38. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Amazing a good deal of terrific information.

    comparison levitra viagra cialis initial use for viagra
    viagra without a doctors prescription
    viagra erektile dysfunktion urologe – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  39. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Amazing many of useful material.

    warren buffett viagra four filters nhs and viagra
    buy viagra online
    red viagra – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  40. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Beneficial posts. With thanks!

    viagra perscription usda patent expiration date for viagra
    viagra generic
    viagra how soon before sex – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  41. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Thank you, I like it!

    viagra and dosage red and yellow chinese viagra
    viagra generic
    viagra fruit – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  42. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You actually revealed it terrifically.

    viagra and cancer begining viagra dose
    viagra pills
    idose viagra – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  43. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Incredible a good deal of useful information.

    viagra manufacture order 50mg viagra
    viagra for sale uk
    boy viagra – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  44. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You made the point.

    buy viagra in amsterdam viagra or dosage
    generic viagra
    canada’s viagra number online pharmacy – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  45. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Many thanks. I enjoy this.

    viagra contents penis size post viagra
    viagra 100mg
    cheapest viagra – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  46. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Beneficial info. Thanks.

    where to find viagra in bangladesh re viagra
    generic viagra 100mg
    man viagra – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  47. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Good postings, Regards!

    viagra levetra methylone and viagra
    viagra for sale uk
    bob dole viagra – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  48. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Appreciate it! A good amount of postings.

    buy viagra in stoke on trent viagra vitamans
    viagra for women
    buy viagra las vegas – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  49. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You suggested this wonderfully.

    viagra rules cheapest line viagra
    cheap viagra
    viagra uk delivery – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  50. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You’ve made your point!

    experimenting with viagra for young men bendroflumethiazide viagra
    viagra for women
    viagra commercial – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  51. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Superb forum posts. Thanks!

    viagra high altitude sickness why you shouldn’t take viagra
    buy viagra
    viagra title object object – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  52. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Wow many of great knowledge!

    viagra pharmacy cyalis versus viagra
    viagra pills
    luxury hotel rome uk viagra supplier – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  53. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You said it perfectly.!

    viagra american express viagra 50 side effects
    viagra for women
    viagra and the subliminal message – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  54. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You actually mentioned that exceptionally well.

    prevent headache when taking viagra viagra safty
    viagra online
    viagra online uk prescrition – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  55. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Regards. I appreciate it.

    expired date viagra generic viagra efficacy
    viagra for women
    viagra won’t work – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  56. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Cheers. I value it.

    vision problems resulting from viagra informacion sobre viagra
    buy viagra
    cheap generic overnight viagra – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  57. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You reported that superbly.

    buy viagra in united kingdom viagra and sinusitis
    buy viagra
    viagra online ticino – https://genericviagramsl.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  58. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    You suggested it adequately!

    viagra cialas levitra comparison buy online viagra in the uk
    viagra online
    excel viagra – https://genericviagrarcp.com

    Geralddal
    Dwaynewaf
    Kevinpuh

  59. Posted by LarrySmite Reply
    Your comment is awaiting moderation.

    Regards! A lot of tips.

    viagra h omepage watermellon viagra news
    cheap viagra
    natural viagra replacement – https://genericviagrantx.com

    Geralddal
    Dwaynewaf
    Kevinpuh

Leave a Reply