| Uwe 的个人资料CRM space日志 | 帮助 |
|
|
2月16日 Use GeoNames, Microsoft Virtual Earth and Flickr with CRM 4.0The last days I tried to integrate GeoNames, Microsoft Virtual Earth and Flickr in my CRM 4.0 VPC. This article describes how you:
This solution is only a demonstration. If you use the entire solution or parts of it you must comply with the terms and conditions of the used 3rd party suppliers. The coding and the error handling is not always optimal and some scenarios could be improved. 1. Necessary preparations for all scenarios a. Add the two existing attributes “Address 1: Latitude” and “Address 1: Longitude” to the account form. Add a new tab called “Virtual Earth / Flickr” to the form. b. Add two new sections (“Virtual Earth” and “Flickr”) and iframes (“IFRAME_VirtualEarthFrame” and “IFRAME_FlickrFrame”) to the tab “Virtual Earth / Flickr”. The urls of the two iframes are mapped to two local .net web pages. You must change the url of those local .net web pages, if you install the pages on a server. If you run the pages from visual studio (debugging with ASP.NET Development Server) you must probably change the port number (currently 2047). c. Add the content of the file “Account.OnLoad.js” to the OnLoad-Event of the account form. The onchange events of the fields “City” and “ZIP/Postal Code” are mapped to a function, which calls a local .net web service. This web service queries the web service of geonames.org with the value of city or zip/postal code to get the appropriate cities. You must change the url of the local .net web service, if you install this web service on a server. If you run the web service from visual studio (debugging with ASP.NET Development Server) you must probably change the port number (currently 1737). If the result from geonames.org contains more than one city, a local .net web page is displayed as popup. You must change the url of this local .net web page, if you install this page on a server. If you run the page from visual studio (debugging with ASP.NET Development Server) you must probably change the port number (currently 2047). The onchange events of the fields “Address 1: Latitude” and “Address 1: Longitude” are mapped to a function, which reloads the flickr iframe. For this iframe a local .net web page exists, which loads the photos from Flickr. You must change the url of this local .net web page, if you install this page on a server. If you run the page from visual studio (debugging with ASP.NET Development Server) you must probably change the port number (currently 2047). d. Save and publish all changes of the account entity. 2. Auto complete function for city name or zip/postal code with GeoNames If you enter a city name or a zip/postal code a query of the web service of geonames.org is made. If no match is found, a message is displayed. If exactly one city is found, the values of this match (city name, zip/postal code, state, country, latitude, longitude) are filled in the crm fields. If more than one city is found, a .net web page with a dropdown list is displayed. On this page you can select the different cities and display those cities on a Microsoft Virtual Earth map. 3. Use of Microsoft Virtual Earth The Microsoft Virtual Earth map is displayed on a local .net web page within a crm iframe. You can locate the current account address on this map and calculate a route from your user address (the values are changeable) to the account address. If you change one of the following fields, these values are filled in the according fields on the .net web page. The fields are: “Street 1”, “City”, “State”, “ZIP/Postal Code” and “Country”. The address of the current user is determined at the page load event of the .net web page and can be changed by the user. 4. Use of Flickr Photos from Flickr are displayed on a local .net web page within a crm iframe. If you change one of the following fields, the .net web page is reloaded with those values as parameters. The fields are: “Address 1: Latitude” and “Address 1: Longitude”. The web page queries the flickr web service to get at most 100 geo-tagged photos taken near the account address latitude and longitude and with the account name in name or description. Keep in mind that the latitude and longitude values are from Geonames and these values mark the center of the city and not the street of the account (needs to be improved). If you have any questions or suggestions please don't hesitate to contact me. Here you can download the entire solution. 评论 (1)
引用通告 (4)此日志的引用通告 URL 是: http://uwekaessner.spaces.live.com/blog/cns!21916E8556D908E!208.trak 引用此项的网络日志
|
|
|