Using the Mapping Component with On-Premise Sage CRM

The Sage CRM Blog

Articles of general interest about Sage CRM, the community, add-ons and general news!

Using the Mapping Component with On-Premise Sage CRM

  • Comments 19
  • Likes

Updated: 06 June 2018

About the Mapping Component

The Sage CRM Mapping Component allows users to mark companies, cases, opportunities, and leads on a map in Sage CRM. Users can also view nearby hotels, airports, pubs, and restaurants on the map. The Mapping Component is compatible with Sage CRM versions 2018 R2, 2018 R1, 2017 R3, 2017 R2, 2017 R1, 7.3 SP3, 7.3 SP2, 7.3 SP1, and 7.3.

When configuring the Mapping Component, system administrators can select a map service provider to be used. For example, OpenStreetMap and its contributors, Stamen, Esri, F4map, Komoot, or ViaMichelin.

To use the Mapping Component, the client computers must have Internet access. The component embeds unencrypted content from a remote website, so it doesn’t work on browsers that use SSL.

In this blog post:

Installing and configuring the Mapping Component

Before installing the Mapping Component, make sure that your Sage CRM license allows you to use the Component Manager.

Step 1: Enable CLR integration on the Sage CRM database

  1. Open SQL Server Management Studio and connect to the SQL Server hosting the Sage CRM database.

  2. In Object Explorer, expand the root node, expand Databases, and locate the Sage CRM database. By default, this is CRM.

  3. Right-click the Sage CRM database and click New Query.

  4. Enter the following SQL query and click Execute:

    sp_configure 'clr enabled', 1

  5. Select the last two lines in the query and click Execute again:


Step 2: Generate a MapQuest consumer key

The Mapping Component uses a free map search provided by MapQuest. To enable the map search in Sage CRM, you need to create a MapQuest account, generate a consumer key, and then provide that key to the Mapping Component.

  1. Set up a MapQuest account at
    You’re automatically logged into your new account.

  2. Click Manage Keys.

  3. Click Create a New Key.

  4. In App Name, enter any name.

  5. Leave Callback URL blank.

  6. Click Create App.

  7. Click the name of your app to display its details.

  8. Copy the consumer key. You will need it in Step 4 below.

Step 3: Install the Mapping Component

  1. Make sure that your Sage CRM license allows you to use the Component Manager.

  2. Download the Mapping Component from

  3. Log on to Sage CRM as a system administrator.

  4. Click <My Profile> | Administration | Customization | Component Manager.

  5. Under Add Component, browse to select and open the .zip file you downloaded in step 2.

  6. Click Upload New Component. The component is added to the Available Components list.

  7. In Available Components, select Sage CRM Mapping Component, and click Install Component.
    Ensure you select the latest download of the component. If you’ve installed the Mapping Component before, the latest version has a number after the name. For example, MappingComponent(1).zip.

  8. Under Apply all changes? select Yes
    WARNING: Do not select the checkbox below this option, as this uninstalls the component. This checkbox does not confirm that you agree to terms and conditions.

  9. Click Install Component. If prompted, confirm that you want to install the component.

  10. When the installation completes, click Continue.

Step 4: Configure the Mapping Component

In this step, you enable the map search and select the map service provider to be used with the Mapping Component.

  1. On the Sage CRM server, open the following folder:
    <Sage CRM installation folder>\WWWRoot\CustomPages\xtmp_Maps

    The default Sage CRM installation folder is

  2. Open the settings.js file in a text editor such as Notepad.

  3. In the file, locate and edit the following:

    In this code, replace CONSUMER KEY with the consumer key you obtained from MapQuest.

    var mapObj = {
                  name: "MapTiles",
                  url: [
    In this element, uncomment the URLs of the map service provider you want to use.
    You can use only one provider. When switching providers, make sure to comment out the URL of the provider you switch from.
    WARNING: Do not uncomment the names of map service providers. If you do so, the Mapping Component won’t work.

  4. Save the file.

  5. Refresh the browser cache by pressing Ctrl + F5.
    After you change the settings.js file, for example, select a different map service provider, every user must refresh their browser cache for your changes to take effect.
    The Mapping Component is now ready to use.

Using the Mapping Component

Once you have installed and configured the Mapping Component, the Map tab becomes available for companies, cases, opportunities, and leads. 

Specifying locations for entities

Out of the box, Sage CRM database doesn’t contain GPS coordinates for entities. To accurately display a company, case, opportunity, or lead on the map, you must specify its location manually.

  1. Click the Search arrow on the top bar and click <Entity>.

  2. Search for the entity record and open it.

  3. Click the Map tab.

  4. Click Search. The address is displayed in the search box and a pin is displayed in the approximate position of the address.

  5. Click Change location.

  6. Move the pin to the exact location.

  7. Click Save location.

Adding a map gadget to the interactive dashboard

  1. Create a map gadget and add it to the dashboard:

    1. Click My CRM | Dashboard | New Gadget | Create Gadget.

    2. Click Web Site.

    3. In Web Address, enter the following:


    4. Click Next.

    5. Enter a name for the gadget and click Finish.

  2. Create a list gadget and add it to the dashboard:

    1. Click New Gadget | Create Gadget.

    2. Click List.

    3. Select an entity to base your gadget on and click Next.

    4. Select the data source to base your gadget on and click Next.

    5. Select the columns to display or select Select All.

    6. Select a Default Action and click Next.

    7. Add a Name and Description for the gadget, and click Finish.

  3. Link the list gadget to the map gadget:

    1. Click the Links icon on the list gadget.

    2. Click New Link.

    3. Select sends data to.

    4. Select the map gadget in the right-hand drop-down.

    5. Select the data that's linked between the gadgets.

    6. Click OK and click Close.

Displaying information on a map

  1. Click the Search arrow on the top bar and click <Entity>.

  2. Search for the entity record and open it.

  3. Click the Map tab.

  4. Select the entities and amenities that you want to display on the map.

  5. Select the radius that you want to view on the map.

    • Entities are displayed on the map for the selected radius only and are limited by distance.

    • Only active and in progress entities are displayed.

    • Amenities are displayed on the map with unlimited distance.

    • Only 30 pins of each type are displayed at once even if there are more than 30 relevant pins. These are chosen randomly.

    • Click a pin on the map to display more information about the relevant entity or amenity.

  6. Click Center Map to return to the active entity.

Removing the Map tab

You can remove the Map tab from Sage CRM. This, however, doesn’t uninstall the Mapping Component.

  1. Click <My Profile> | Administration | Customization | Component Manager.

  2. Select the Mapping component from the Available Components list.

  3. Click Install Component.

  4. Select Check this to uninstall the Mapping Component.  

  5. Click Install component. The Map tab is no longer displayed.

  • For those asking about bulk populating these, I used this site to convert the bulk of my postcodes into latitude and longitude. I then used this site for the Northern Ireland postcodes as the first site did not work well for them: You can then do some magic in Excel to create some statements like this (note that the CRM field uses Longitude then Latitude so be sure to swap the values around from the web results):

    update company set comp_xtmp_longlat = geography::STPointFromText('POINT( -5.84218 54.70863 )', 4326) where comp_companyid = 26 ;

    This worked well for me and I now have the majority of my UK companies mapped!

  • What I'd like to see is some decent examples of how to extend his component. For example, I have a multi select against a company record that contains product families. I have altered the ASP in the main screen, MapsTab.asp, so that I have hidden the overlays for restaurants, pubs, etc., and in its place I have put a function that generates a checkbox list in the same way but containing product families.

    It's clear that I need to put in some click handlers somewhere but sadly I'm not familiar with jQuery, json, or ajax so it's going slowly. I can see there is a function in MapsTab.js called entityLookup which determines which ASP page to push the ajax call to. When dealing with companies only it wants to called GetCompanies.asp which is fine. I thought maybe I could alter that ASP page to determine which checkboxes are checked but by the time this page is called, the form containing the checkboxes is gone. So, my next plan is to try and alter the querystring passed to GetCompanies.asp.

    Any suggestions would be good.

  • I've noticed that in the NOTES section of this component it says, "The component embeds unencrypted content from a remote website, so the component doesn’t work when HTTPS is enabled."

    Using OpenStreetMap - Mapnik, I'm able to load their SSL tiles by simply adding https to the tile calls:




  • Trying to follow the mapping component download link gives me "Access Denied".