Are you sure you want to quit the chat?
Bing Maps integration in Dynamics 365 Customer Engagement (CE) offers an intuitive way to visualize customer locations on entity forms like Contacts, Accounts, and Leads. However, out-of-the-box, Bing Maps relies on Address 1 and Address 2 fields, which include text fields for state, country, and other address details. This presents a challenge when clients require structured data, like dropdowns, for address components such as the state field.
In this blog, I will explain how to enable Bing Maps, what address fields it uses, and provide a workaround for situations where dropdowns or custom fields are needed. By leveraging custom fields and JavaScript, you can ensure the user selects from dropdowns, and Bing Maps gets the correct address information without disrupting the default behavior.
Before customizing address fields, ensure that Bing Maps is enabled in your Dynamics 365 CE environment. Follow these steps:
1. Navigate to Admin Center: Go to the Power Platform Admin Center.
2. Enable Bing Maps:
– Select the appropriate environment.
– UnderFeatures, toggle Bing Maps integration to “On.”
Once enabled, Bing Maps automatically displays on entity forms that contain the default address fields.
By default, Bing Maps in Dynamics 365 CE is tied to two sets of address fields: Address 1 and Address 2. Each set includes several fields like:
Address 1:
Address 2:
These fields are text-based, meaning users must manually enter values such as the state, country, or city. This can lead to data entry inconsistencies and may not satisfy clients who require structured data inputs, like dropdowns for state or country.
When clients want dropdown options (Option Sets) for fields like State or Country, the default address fields don’t accommodate this need. Simply replacing the Address 1 or Address 2 fields with custom fields won’t work, as Bing Maps requires those default address fields for geolocation.
To solve this problem, the best approach is to create new custom fields (e.g., dropdowns for states or countries), hide the default Address 1 and Address 2 fields from users, and use JavaScript to copy the values from the custom fields back into the corresponding Address 1 or Address 2 fields for Bing Maps to function correctly.
Here’s how you can implement this workaround:
Since Bing Maps only works with Address 1 and Address 2 fields, you need to copy the values from the custom fields into those fields behind the scenes. This can be achieved using JavaScript.
1. Create a JavaScript Web Resource:
2. Write the JavaScript Code:
Here’s an example of JavaScript that copies values from custom fields into the default Address 1 fields:
3. Attach the JavaScript to the Form:
4. Save and Publish the form.
Now that the custom fields are set up to synchronize with Address 1 and Address 2, you can hide the default fields from the users:
1. Navigate to the Entity Form (e.g., Account or Contact).
2. Fill Out the Custom Address Fields.
3. Check the Bing Maps Display:
Although Dynamics 365 CE does not natively support using Option Sets or other field types directly in the default Address 1 and Address 2 fields for Bing Maps, this workaround offers a clean solution. By creating custom fields, copying their values using JavaScript, and hiding the default fields, you can meet client requirements for structured input (e.g., dropdowns for state and country) while maintaining the Bing Maps functionality.
This approach allows you to achieve both flexibility and functionality without compromising the user experience or data consistency.
As part of the deduplication process, we also updated our reference table to reflect old-to-new key mappings. This allowed us to ensure that the correct GUIDs were assigned to the deduplicated records, maintaining the integrity of the data relationships in CRM.
At ITKnocks, we are more than an IT consulting company; we’re your strategic partner in business evolution. With a global footprint and a passion for technology, we craft innovative solutions, ensuring your success. Join us on a journey of excellence, where collaboration meets cutting-edge IT expertise.