Home > MSCRM General, CRM Development, CRM Deployement, CRM Integrations > MSCRM and MapPoint Integration – A picture is worth a thousand words.

MSCRM and MapPoint Integration – A picture is worth a thousand words.


Microsoft Provides MapPoint Web Service to enrich application with mapping functionality. It allows you to integrate maps, driving directions, order tracking and proximity searches into a wide range of solutions.

For those of you who want to start using MapPoint for test and development purposes you can sign up for a free developer account here:

htt
ps://mappoint-css.partners.extranet.microsoft.com/MwsSignup/Eval.aspx

With a developer account, you get full access to the MapPoint Web Service APIs and staging environment, which you can use to build applications for trial, demonstration, and proof-of-concept purposes.

Overview

Overview

Microsoft Dynamics CRM Account entity already has longitude and latitude parameters for address. But mostly organizations don’t use those parameters. MapPoint web service provides FindAddress service to resolve addresses and returns longitude and latitude parameter as shown in the code snippet below. 


Find Address Longitude and Latitude FindServiceSoap FindService = new FindServiceSoap ();
FindService.Credentials = new NetworkCredential(“”, “”);
FindService.PreAuthenticate = true;
MyAddress mAddress = new MyAddress();

mAddress = (MyAddress)addresses[i];

FindAddressSpecification spec = new FindAddressSpecification();
spec.InputAddress = new Address();
spec.InputAddress.AddressLine = mAddress.Line1;
spec.InputAddress.CountryRegion = mAddress.Country;
spec.InputAddress.Subdivision = mAddress.StateProvince;
spec.InputAddress.PrimaryCity = mAddress.City;
spec.InputAddress.PostalCode = mAddress.Postalcode;
spec.DataSourceName = “MapPoint.NA”;
FindResults results = FindService.FindAddress(spec);

Populating Location and Pushpin Array 

Location and pushpins objects require longitude and latitude values for address. Following code is used to populate Location and Pushpin objects of MapPoint API. 


Location[] myLocation = new Location[addresses.Count];
myLocation[i] = new Location();
myLocation[i].LatLong = new LatLong();
myLocation[i].LatLong = results.Results[0].FoundLocation.LatLong;
Pushpin[] pushpins = new Pushpin [addresses.Count]; pushpins[i] = new Pushpin();
pushpins[i].PinID = “pin0″;
pushpins[i].IconName = “0″;
pushpins[i].Label = mAddress.Name;
pushpins[i].IconDataSource = “MapPoint.Icons”;
pushpins[i].LatLong = results.Results[0].FoundLocation.LatLong;
There is no simple way to provide hyperlink at Pushpins, although Pushpin label and icon can be set to custom settings. Getting image and automatic zoom based on the geography covered by the addresses

MapPoint Web Service provides Render Service API to automatic zoom based on the geography covered by addresses. Here is the code snippet to do this:

//Call MapPoint Render Web Service RenderServiceSoap RenderService = new RenderServiceSoap();
RenderService.Credentials = new NetworkCredential(“”, “”);
MapViewRepresentations mvRep = RenderService.GetBestMapView(myLocation,”MapPoint.NA”);
mviews[0] = new ViewByBoundingRectangle();
mviews[0] = mvRep.ByBoundingRectangle;
MapSpecification mspec = new MapSpecification();
mspec.Options = moptions;
mspec.Views = mviews;
mspec.Pushpins = pushpins;
mspec.DataSourceName = “MapPoint.NA”;

MapImage[] image = RenderService.GetMap(mspec);

So the final image can be displayed in some ASP.NET page to show in Microsoft Dynamics CRM. Please find below my integration of MapPoint web service with MSCRM. One can select Accounts to be plotted on MapPoint and click Show Accounts Map Button at Account Entity grid toolbar.  All selected accounts will be plotted on the MapPoint in a new web dialog with Invalid addresses at the bottom.  

Step 1 


 Here is the final Image generated in Web Dialog:
Step 2 For any comments or suggestion do let me know. Your suggestions and comments are valuable for me. Thanks!

About these ads
  1. June 13, 2007 at 10:29 pm | #1

    Awesome work Ayaz!
    I would love to do it with SharePoint too, hopefully the results are as fantastic as with CRM……..

    Rehman
    http://rehmangul.wordpress.com

  2. June 13, 2007 at 10:36 pm | #2

    Hi Rehman,

    MapPoint is amazing Web Service. Any application can use this and enrich with Maping features. One just need to provide valid address information to web service. Rest of Simple API will work for you.

    Cheers!

    Ayaz

  3. June 17, 2007 at 6:38 am | #3

    Hi Ayaz, I was looking to integrate a CRM application with a location based system, but also make it work with a wordpress blogging system. Kind of a crazy idea, but I did not think of connecting php world with Microsoft world. I read your post, and saw that you are highly respected from the MS team, and Satya Nadella was also recommended, he was an Advisor to my previous co. I am wondering, what it would take, or is it absolutely crazy to integrate a WordPress engine or at least have it talk with or pass info with a MS Crm? Also email me privately and see if our blogging platform at http://www.mytypes.com may sound interesting to you to help with.

  4. June 17, 2007 at 8:24 pm | #4

    Hi Vipin,

    Microsoft provides Mappoint as a web service. They are plateform and language independent. Just call MapPoint API through PHP using SOAP messaging or whatever mechanism PHP engine use to access web services and utilize them. It is very much possible in PHP.

    Regards,

    Ayaz

  5. Serge
    November 7, 2007 at 3:40 pm | #5

    Hello!

    Can you please send me the code to do this Map integration in CRM for multiple pushpins.
    I can’t find full example on your site.
    Thanks a lot!

    Serge

  6. Faisal Fiaz
    November 20, 2007 at 10:27 am | #6

    Dear Ayaz,
    Is it possible to provide options for a solution that allows CRM users to email contact records with multiple email addresses and be able to select the relevant email address.
    Regards
    Faisal

  7. Mohammed Arif
    May 2, 2008 at 3:19 pm | #7

    Hi Ayaz,
    I want to implement the mapPoint Integeration in MSCRM4.0.Could you plz help me by providing some clear sample code for it.

  8. adi
    August 6, 2008 at 1:49 pm | #8

    I believe the best way of migrating data into Microsoft Dynamic CRM is by using SQL Integration Services (SSIS).
    You can use SSIS script component to write code using the CRM SDK.
    I made a tool that helps generates the DLL required to use from SSIS script component to write Microsoft SDK code. You can download this too for free from this location http://www.ssis4crm.com
    You will fined there interactions of doing a simple load.
    This way is supported by Microsoft (using MSCRM SDK)

  9. November 16, 2008 at 9:46 pm | #9

    Excellent post Ayaz…

    I have been playing with the Yahoo! AJAX map API to deliver similar results:

    http://www.mscrmblog.com/blog/2008/11/16/yahoo-ajax-maps-for-dynamics-crm-part-2.html

  10. Rajas Gokhale
    March 2, 2009 at 10:31 pm | #10

    Ayaz,
    this is fantastic stuff.

    Is it possible to enhance the charting functionality of MapPoint from Excel? I mean can one import following charts
    a. charts having two axes
    b. charts having negative values
    c. line chart
    d. stacked column chart (although this can be transformed into a pie chart which is supported by MapPoint)

    I am thrilled at the prospect of using MapPoint for some of our dashboards but it seems to be capable ofonly a few charts. I appreciate any help you could prvoide and thank you in advance.

    Best Regards,
    Rajas.

  11. RaiulBaztepo
    March 29, 2009 at 12:21 am | #11

    Hello!
    Very Interesting post! Thank you for such interesting resource!
    PS: Sorry for my bad english, I’v just started to learn this language ;)
    See you!
    Your, Raiul Baztepo

  12. March 12, 2013 at 9:19 pm | #12

    Most of these programs outline a set of exercises that strengthen penis size.
    Consequently, it is particularly critical that you go for a medical verify up on a regular basis specifically if you are sexually active
    and have extra than one sexual companion.Female sperm survive perfect in acidic
    circumstances when male sperm choose an alkaline atmosphere much
    better.

  13. meenakshi
    March 14, 2013 at 5:10 am | #13

    can u pls guide me how to use the code step by step process
    as im new to work on with soap

  14. June 8, 2013 at 5:36 pm | #14

    This kind of self-help e-book continues to be authored by Craig McDonagh that has assisted more than 55.
    000 individuals to treatment their anxiousness within around Ten years.
    Todd McDonagh has themself suffered with anxiety previously
    which is precisely how this individual put together this method
    to aid other folks handle stress and anxiety operations issues.

    Cognitive-behavioral treatment the foundation of the actual Panic Away strategy is considered to be probably the most trustworthy and
    also proven way to battle nervousness. It’s the approach the majority of specialist researchers would likely employ to aid combat anxiety attacks. Panic Away is acknowledged for their “One Shift Technique” which usually helps you with the way to reduce your feeling of panic once you feel the 1st warning signs of a panic attack. It can be with different basic technique that will intentions to enable you to quit your current panic attack in 21 seconds and also to conclusion nervousness generally speaking, inside of Seven min’s.
    The article author is quite available while using idea that alleviating General Panic (GAD)
    usually takes in regards to a 30 days or more to start out really experience various, but for basically halting
    anxiety attacks comfort come in units.

    Based on Winner Frankl, one of many earth’s best psychiatrists, this method is the merely true cure for anxiety. It’s not at
    all treatment, it’s not at all trance, certainly not chinese medicine or other peculiar strategy, just straightforward, simple mindset with a unique approach to stress and anxiety supervision. It is going to educate you on how to crack your anxiety cycle and not just cope with the panic and anxiety attack, yet turn your dining tables upon anxiety along with discover ways to to not ever fear another panic attack again. While there are numerous self-help techniques directed at assisting you to defeat your anxiety, a lot of them need you to revert towards the earlier, for the 1st panic or anxiety attack you have ever seasoned, as well as dig up the basis grounds for it. Whilst they may show to be effective in the long term, results may take a long time to be felt. Your Panic-Away method begins operating instantly and in addition it educates ways to use it throughout everyday life circumstances for example any time traveling your car or truck, having a plane as well as venturing out with a time.

  1. February 14, 2008 at 8:27 am | #1
  2. March 3, 2008 at 6:42 pm | #2
  3. March 5, 2008 at 4:57 pm | #3

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 50 other followers

%d bloggers like this: