This project is read-only.

Steps to configure this app:

Get Bing Map key.

1. Get Bing Map key from here.
2. Open Web Resource <BingMapKeys> in Text Editor and insert the key
3. Publish the Customizations.



 

 

 

 

 

 

Configure Entity form to fill latitude and longitude fields.

1. Edit <entityAddressFields.xml> web resource to add address fields of the entity. Here is how it looks:
<entities>
<entity name="account">
<city name="address1_city"></city>
<state name="address1_stateorprovince"></state>
<country name="address1_country"></country>
<postalcode name="address1_postalcode"></postalcode>
<latitude name="address1_latitude"></latitude>
<longitude name="address1_longitude"></longitude>
</entity>
<entity name="new_custom">
<city name="new_city"></city>
<country name="new_country"></country>
<latitude name="new_lat"></latitude>
<longitude name="new_long"></longitude>
</entity>
</entities>
Make sure name of the fields are correct logical names.

2. Customize the Main Entity form and add all the fields on form which were added in step1.
3. Insert <LocateAddress> web resource preferably below the address fields.
4. Publish all the customizations.

Note: Conversation of Address into LatLong is done using Bing maps API. Result may not be accurate and sometimes it could fail in finding the LatLong. You may consider less number of fields (just state and city) to get result and then user can manually change the latlong, by right clicking in the map. This way you should be able to locate address accurately.

To Test: Open the entity record. Fill the address fields and click "FillLatLong".


 

 

 

 

 

 

 

 

 

 

 

 

Configure settings to display records on Bing Map.

1. Using AdvancedFind, generate the FetchXml on which you want to filter the records to display on map. Save the fetchxml, say in notepad.
2. Open <BingMapConfig.xml> Web Resource.
3. Open Text Editor and copy the whole xml and save it in local xml file.
4. Open the above saved xml file in your favorite xml editor.
5. Add or replace one of the entity node with the entity you want to show on dashboard. Sample xml file included in the solution contains entries to display Account and Contact records. Here is how it looks:
<entities>
<globalsettings>
<near text="Near">
<area name="washington"></area>
</near>
</globalsettings>
<entity name="account" displayname="Account">
<fetchXml>
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="account">
<attribute name="name" />
<attribute name="address1_city" />
<attribute name="primarycontactid" />
<attribute name="address1_latitude" />
<attribute name="address1_longitude" />
<attribute name="websiteurl" />
<attribute name="address1_country" />
<attribute name="revenue" />
<attribute name="description" />
<order attribute="name" descending="false" />
<filter type="and">
<condition attribute="statecode" operator="eq" value="0" />
{0}
{1}
</filter>
<link-entity name="contact" from="contactid" to="primarycontactid" visible="false" link-type="outer" alias="accountprimarycontactidcontactcontactid">
<attribute name="emailaddress1" />
</link-entity>
</entity>
</fetch>
</fetchXml>
<address>
<latitude name="address1_latitude"></latitude>
<longitude name="address1_longitude"></longitude>
</address>
<Conditions>
<mapcondition text="Name Contains: ">
<condition attribute="name" operator="like" value="%{0}%" />
<value type="string" default=""></value>
</mapcondition>
<mapcondition text="City: ">
<condition attribute="address1_city" operator="like" value="%{0}%" />
<value type="string" default=""></value>
</mapcondition>
</Conditions>
<displaypanel>
<links>
<link text="Website">
<field name="websiteurl"></field>
</link>
</links>
<list>
<listitem text="Name">
<field name="name"></field>
</listitem>
<listitem text="City">
<field name="address1_city"></field>
</listitem>
<listitem text="Country">
<field name="address1_country"></field>
</listitem>
<listitem text="Revenue">
<field name="revenue"></field>
</listitem>
<listitem text="Description">
<field name="description"></field>
</listitem>
</list>
<tooltip text="Account Pushpin">
<field name="name"></field>
<color name="blue"></color>
<zoomlevel name="10"></zoomlevel>
</tooltip>
</displaypanel>
</entity>
6. In order to add new entity, copy <Account> entity complete node and paste it.
7. Now start replacing fields with the names and strings that you want to use.
8. The condition for which you want the input from user, you need to put placeholder in fetch and add the mapcondition node at corresponding index.
9. Any attribute which is referenced in the xml should must be included in the fetchxml attributes.
10. Save the xml file and upload again in the same web resource.
11. Publish all the customizations.

Note: This step should be done with extra care as any in-correct will lead to error on map and you may or may not see any data on map.
Make sure for each of the placeholder in fetch, there is a mapcondition node under Conditions. Also, the order of mapconditions should be same as the index of placeholders.
Even if you don't want any default value for some mapcondition, still you need to add value node with default value empty string("") as shown above.
In order to keep things simple, I refer to add upto 3 fields of each type(link, listitem, mapcondition), although there is no limitation.

Create Dashboard and add <BingMapBrowser> HTML type web resource in it.

Last edited Apr 29, 2011 at 2:24 PM by atulcrm, version 2

Comments

X2Factor Aug 19, 2013 at 2:49 PM 
hi Atulcrm,

I am able to make the map work on individual entities (Account). the only problem i have it making it work on the Dashboard. I have tried the default solution (Xml) it doesn't work for me. the error i get when the Dashboard loads is "Exception Occured: Input string was not in a correct format". would you kindly help me with this one.

Regards,

renatodelrei Feb 5, 2013 at 1:25 PM 
Hello Atul, greate work. Thank you for this. I'm having some problems showing records on dashboard. It doesn't give me any error but the records are not present on it. "Restrict cross-frame scripting" is un-checked. Tried lots of "BingMapConfig.xml" customizations and even the default one. The map is visible but none records.

If I click the load button it gives me "Metadata for entity not set".
Can you help me?

Thank you.

atulcrm Jul 12, 2012 at 10:55 AM 
Please post issues on Discussion forum, as it is difficult to interact in comments section and get track of issue.
Thanks!

lasanjay Jul 11, 2012 at 4:40 AM 
Hi, I cannot get the silverlight component working in the dashboard, it gives me a blank screen.
I know similar issues have been reported before. The only difference i noticed is, my browser has Silverlight 5 installed. Could you please try running your solution with Silverlight 5 installed?

kgutzeit May 2, 2012 at 4:47 PM 
I had also problems with the same issue so I started to use the IE Debug function this resulted in the following message within the function onSilverlightError(sender, args):

line 58, File: new_BingMapBrowser
"Unhandled Error in Silverlight Application \nCode: 1001 \nCategory: DownloadError \nMessage: 1001 Ein Fehler ist aufgetreten. \n"

Whe are using the Dynamics CRM Application within our Intranet, so I followed the hint within the Thread "Configuration Tips" and tried to use only the short variant of the domain name (...."http://crm-server.domain.com, only the map would display with no entities. If I use http://crm-server, the map would display with the entities loaded correctly...") and finally it works with displaying all Entities.

This application is fantastic but it would be nice to find out where this known error is. Are there any possibilities to remote debug the Silverlight Application?

best regards from Germany

JhonPeter Apr 30, 2012 at 11:13 AM 
Hi. I'm facing with warning error like "do you want to see only the contents of the web pages where the content is secure". More over i'm getting indefinitely an error like "object has null value"

ns1302 Mar 21, 2012 at 12:12 PM 
Hi Atul, even I tried implementing the same, but same like others, I am also facing a problem with Dashboard. It is not giving any error, & it's not working also. Whenever I try running the webresource in a Preview mode it works absolutely fine, populates the data on the map. But, when I try from the Dashboard tab in the left nav pane it doesn't work. Please guide, that how to proceed further. Thanks

planit Jan 7, 2012 at 5:05 AM 
Hi atulcrm, I am also getting a blank screen when trying the dashboard. The html file doesn't display either. I have tried this with and without modifying any of the xml files. I have put the longitude and latitude fields on the account form and populated them. Please help?

atulcrm Dec 16, 2011 at 4:56 AM 
Have you un-checked the "Restrict cross-frame scripting" checkbox in html web resource properties dialg while adding on dashboard. Otherwise scripts won't run and could be the reason for blank screen.
Please try "In action" solution as well.

mrcfld59 Dec 11, 2011 at 6:07 PM 
I've the same problem with the dashboard, It did'nt give any error, but I can't see any account information on the dashboard. If I click the link on the web resourse (html file) it works fine.

atulcrm Nov 22, 2011 at 11:30 AM 
When you add BingMapBrowser html type web resource on dashboard, make sure that "Restricted cross-frame scripting" checkbox is un-checked. It is present in the properties dialog of web resource.

atulcrm Nov 22, 2011 at 11:11 AM 
Please provide more details. Are you getting any error message or any script error on the page? Seems that it is working for most of the people. Also if you are just using the default configuration, please try from different machine, it could be due to some restricted IE settings. If nothing works, please provide me the screenshots and detailed repro steps, so that I can reproduce the issue on my side.

mhammo Nov 18, 2011 at 2:09 AM 
Same for me. Cant get dashboard to work. Please provide more detail for this.

leontribe Sep 6, 2011 at 7:02 AM 
I am at the same point as keneo. I can get it working on individual records but I am not sure how to edit the xml to make it work with the dashboard. All I get is a white box. Assuming I am using a vanilla system, which parts of the configuration xml need to be edited to display all account and contact records?

atulcrm Aug 12, 2011 at 7:35 AM 
Please provide more details regarding the error you are getting.

keneo Jun 28, 2011 at 2:07 PM 
Hi. The Latitude-Longitude worked fine and it was of good help.
Can you please share detailed documentation on process of displaying the dashboard with bing maps since I was unable to do so with the above insttruction for dashboard.