Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Any way to get Google Maps on a (custom) entity in Dynamics 365 for Sales?

(3) ShareShare
ReportReport
Posted on by 28
Hi there,
 
A customer of mine requests a Google Maps function in their Dynamics 365 for Sales. This applies to both standard entities and a custom entity. What they would like is the following: when an address is filled in, it should pinpoint the location on Google Maps (kind of like what happens with Bing Maps, but then Google Maps).
 
I have found a few threads about this in which a webresource is used. I can't quite get it to work, so I'm hoping there is someone here who can help me out. A webresource or a plugin would both be fine, as long as it works for custom entities as well.
 
Thank you in advance!
Categories:
  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    7,336 Super User 2025 Season 1 on at
    Any way to get Google Maps on a (custom) entity in Dynamics 365 for Sales?
    Hello Stieben,
     

    I understand you're still having trouble getting the Google Maps integration to work. Let's troubleshoot your specific implementation. To help me understand what might be going wrong, could you please provide some more detail about what you've done so far and where you're encountering issues? Specifically:

    • API Key: Have you obtained a Google Maps API key and correctly replaced YOUR_API_KEY in the HTML web resource code? Ensure the Maps JavaScript API and Geocoding API are enabled for your key.

    • CRM Field Names: Are you using the correct logical names for your address fields in the getAddressFromCRM function? Double-check these in the Solution Explorer. If you're using a composite address field, are you using Xrm.Page.getAttribute("address1_composite").getValue();?

    • Web Resource Upload: Did you successfully upload the HTML web resource to Dynamics 365 and select it in the Web Resource control on your form?

    • Event Handling: Did you add the getAddressFromCRM function to the OnChange event of the address fields (and potentially the OnLoad event of the form)? Are there any errors in the browser's developer console when the form loads or when you change the address fields?

    • Code Modifications: Have you made any modifications to the HTML or JavaScript code I provided? If so, please share those changes.
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak
  • Tom_Gioielli Profile Picture
    1,576 on at
    Any way to get Google Maps on a (custom) entity in Dynamics 365 for Sales?
    +1 to PCF control, that would hands down be the best way to meet this requirement.
  • Suggested answer
    Robert Bailey Adoxio Profile Picture
    8 on at
    Any way to get Google Maps on a (custom) entity in Dynamics 365 for Sales?
    Just to add to the answer below - Personally i'd go with a PCF Control.  

    Yes you will need an API key for anything to function, but PCF to me is better than a web resource.

    Also, i'd suggest probably doing everything client-side in terms of storing data into your dataverse record.  I'm not sure why you'd use a plugin to call the google maps API - you want to do that client-side via ajax / typescript at the time the user selects an address on the map UI.

    You might want to be able to control your own nuances, but you could start off by unpacking this: https://pcf.gallery/google-maps-control/

     
  • Suggested answer
    Holly Huffman Profile Picture
    6,078 on at
    Any way to get Google Maps on a (custom) entity in Dynamics 365 for Sales?
     
    Good morning, afternoon, or evening depending on your location!
     
    Yes! You can integrate Google Maps into Dynamics 365 for Sales using a web resource or a custom plugin. Here’s how:
     
    Option 1: Web Resource (JavaScript)
    You can create an HTML web resource that embeds Google Maps using the Google Maps API. This method works for both standard and custom entities.
    Steps:
    1. Get a Google Maps API Key – Sign up for an API key from Google Cloud.
    2. Create an HTML Web Resource – Write JavaScript to load Google Maps based on an address field.
    3. Embed the Web Resource – Add it to the form where you want the map to appear.
     
    This will display a Google Map based on an address field.
     
    Option 2: Custom Plugin
    If you need deeper integration, you can create a custom plugin that uses Google Maps as a geospatial data provider instead of Bing Maps.
    Steps:
    1. Develop a Plugin – Use the Google Maps API to fetch location data.
    2. Register the Plugin – Deploy it in Dynamics 365 to process addresses dynamically.
    3. Use the Plugin in Forms – Configure it to display maps based on entity data.
     
    Microsoft provides a sample plugin for using Google Maps instead of Bing Maps in Universal Resource Scheduling. You can check it out here.
     
    Troubleshooting Web Resource Issues
    If your web resource isn’t working:
    • Check API Key Restrictions – Ensure your Google API key allows Maps usage.
    • Verify Address Field Mapping – Make sure the script pulls the correct field from Dynamics.
    • Test in a Standalone Browser – Run the HTML file outside Dynamics to debug errors.
     
    Please note: I teamed up with CoPilot AI to research and craft the best response to your question!
    Hope this helps some!
     

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

#3
Eugen Podkorytov Profile Picture

Eugen Podkorytov 102

Overall leaderboard

Product updates

Dynamics 365 release plans