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 16
  • Likes

What is the Mapping component?

The Sage CRM Mapping component allows users to plot 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 7.3 and Sage CRM 2017 R1. It requires Microsoft SQL Server 2008 or later.

Note: You must have Internet access to MapQuest to use the Mapping component. The component embeds unencrypted content from a remote website, so it doesn’t run on browsers that use SSL.

Setting up and using the Mapping component

  1. Enable CLR on Microsoft SQL Server
  2. Create a MapQuest account and app
  3. Install the Mapping component
  4. Add a map gadget to the interactive dashboard (optional)
  5. Associate GPS coordinates with an entity
  6. Display information on a map
  7. Uninstalling the Mapping component

Step 1: Enable CLR on Microsoft SQL Server

  1. Click Start | SQL Server Management Studio.
  2. Enter your password and log in to Management Studio.
  3. Select CRM from the database drop-down on the top bar.
  4. Click New Query.
  5. Enter the following lines:

    sp_configure 'clr enabled', 1

    GO

    RECONFIGURE

    GO

  6. Click Execute.
  7. Highlight the last two lines:

    RECONFIGURE

    GO

  8. Click Execute again. 

Step 2: Create a MapQuest app

  1. Set up a MapQuest account at https://developer.mapquest.com/plan_purchase/steps/business_edition/business_edition_free/register. You’re automatically logged into your new account.
  2. Click Keys & Reporting.
  3. Click Create a New Key.
  4. Specify your App Name.
  5. Leave Callback URL blank as it’s not required.
  6. Click Create App.
  7. Click your app link to display details of the app.
  8. Copy the consumer key for later use.

Step 3: Install the Mapping Component

  1. Go to https://community.sagecrm.com/add_on_store/m/sage_crm_downloads/22244.aspx and download the Mapping component to a location that’s easily accessible.
  2. Click <My Profile> | Administration | Customization | Component Manager.
  3. From the Add Component panel, browse to the Mapping Component ZIP file and click Open.
  4. Click Upload New Component. The component is added to the Available Components list.
  5. Select the Mapping component from the Available Components list 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.
  6. Ensure Apply all changes is set to Yes.
    Warning: Do NOT select the checkbox as this uninstalls the component. This checkbox does not confirm that you agree to terms and conditions.
  7. Click Install Component and then click OK.
  8. Click Continue.
  9. Go to the WWWRoot folder of your Sage CRM installation (%ProgramFiles%\Sage\<InstallPath>\<InstallName>\WWWRoot).
    1. Open CustomPages\xtmp_Maps\MapsTab.js using a text editor such as Notepad.
    2. Search for CONSUMER KEY.
    3. Replace CONSUMER KEY with the consumer key obtained from MapQuest.
    4. Save the file.

Step 4: Add a map gadget to the interactive dashboard (optional)

You can use the Mapping component to create a map gadget and link it to a list gadget on the interactive dashboard. When a user selects an entity in the list gadget, it’s displayed on the map.

  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. Enter the following in Web Address: #crm_server#/custompages/xtmp_maps/gadgetredirector.asp?gadgetPath=custompages/xtmp_maps/mapsgadget.asp.
    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.

Step 5: Associate GPS coordinates with an entity

There are no GPS location credentials in the Sage CRM database. To accurately display a Sage CRM company, case, opportunity, or lead on the map, you must do the following:

  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.

Step 6: Display 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.
  6. Click a pin on the map to display more information about the relevant entity or amenity.
  7. Click Center Map to return the map to the active entity.

Uninstalling 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.
Comments
  • The mapping component is not recognizing any addresses.  I'm getting the error "your search for XXX did not match any locations.  Displaying map for CITY instead" for legitimate addresses.  Is there a troubleshooting guide?

  • Hi Debbie,

    Could you post sample address you searched for?  Unfortunately we don't have any troubleshooting guide for this component yet, personally I'm always using Developer Tools in Google Chrome.

  • We are on 7.3a, I've installed the Mapping Tool as above and altered the MapsTab.asp to include the postcode on both lead and company tabs, but I still cant get the Company Map Tab to work correctly. When I click the tab the search box is empty, when I then click Change Location, the address that appears is the first address I searched for from the Lead map tab, if I change this and put an address in, it saves the pin, if I then select another Company to Map it shows the Map from the previous Company, I then click Change Location to enter a new address and it shows the address from the first Lead again.

    The Lead map tab is working perfectly, displaying Leads in the correct place.

  • Hi David - please can you tell me how you added to include postcode in lookup.  We are using 7.3sp2 and currently it wont look up postcode and it doesn't recognise County, when county is removed and we manually enter the postcode it works!  Would you mind sharing how you changed the file to include postcode?  many thanks in advance, Julie

  • Hi Julie,

    If you follow the guide in the link below:

    community.sagecrm.com/.../27862.aspx

    Entering the highlighted yellow, in the Company section of the mapstab.asp file in \Sage\CRM\CRM\WWWRoot\CustomPages\xtmp_Maps\

    Then this:

    params.addr_postcode = CRM.getContextInfo("Lead","lead_CompanyPostCode");

    in the Leads lookup section.

    Does it currently work for you and save maps against addresses, for both Leads and Companies?

    Thanks

    David

  • I have been having issues, even when doing the steps suggested. For some clients the maps still don't show up, for others the search function and pin aren't showing up!

  • This post was updated on 11/11/2016 to include information about enabling CLR and to combine information from other blog posts.

  • So this mapping component used to work for us but now we're getting a blank map with no images.  In the debug console we're getting messages like...

    GET a.tiles.mapbox.com/.../13533.png 404 (Not Found)

    GET a.tiles.mapbox.com/.../13533.png 404 (Not Found)

    When I browse out to the url it gives me "{"message":"Account over limit."}"

    I've registered for the MapQuest developer key and updated the MapsTab.js file with my consumer key but still no worky.  Anyone else seeing this or know how to fix it?  Thanks.

  • Brad

    I haven't tried the mapping component lately, but based on recent painful experience with js files, you will need to empty your browser cache to make sure the new page is loaded. It might be worth doing a view source to see if the correct code is loaded in the mapping page.

    Tom

  • Ha Ha.  I know what you mean Tom.  That was actually the first thing I did was empty the cache and do a hard refresh.  I'm actually working with someone from MapQuest to hopefully help troubleshoot this issue.  Definitely seems more like a MapBox issue because it's coming back with that "account over limit" json message, but i'm obviously not over my limit because it's never worked :-)  thanks Tom.

  • Well I did find out that apparently MapBox is not part of MapQuest.  Apparently it's just using the MapQuest consumer key to search for an address but it's using MapBox to display the map.  in the url "a.tiles.mapbox.com/.../alanleahy.map-qibhv72z${z}/${x}/${y}.png" the "alanleahy.map-qibhv72z" is the MapId.  I wonder if that MapId has something to do with it.  Maybe that mapId account has reached it's limit??  Back to square one.

  • Well i'm not sure if this is the right answer but I changed the line in MapsTab.js from "a.tiles.mapbox.com/.../alanleahy.map-qibhv72z${z}/${x}/${y}.png" to "api.mapbox.com/.../mapbox.streets${z}/${x}/${y}.png?access_token=" + mapBoxAccessToken.  I have the variable 'mapBoxAccessToken' defined at the top.  I then signed up for a MapBox account and got an access token.  You can sign up here...www.mapbox.com/.../signup

    Anyway like I said not sure if that's the right answer but it works now so that's all that matters :-)

  • Hi Brad

    Thanks for posting. Our development team are aware of this issue and are currently working on a solution. I'll let you know as soon as it is fixed.

    I think your solution will probably not work because your new mapbox account won’t have the necessary images and icons used by the mapping component.

    Many thanks

    Emma

  • Thanks Emma!!  My solution appears to be working okay as far as I can tell.  I'm getting the different pins for company, oppos, cases, etc and the amenities are showing up as well.  but i'm glad you are aware of the issue and are fixing it :-)  Thanks again.

  • Downloaded the component from here: community.sagecrm.com/.../22244.aspx

    I assume that is the right place. Configuration guide refers to Open Street Map. I've been told it has changed to Map Quest and I need an account. The maps when I look at the tab refer to MapBox and not MapQuest.

    So, definitive answer please. What system is it using? MapBox? Do I need an account? Can the configuration guide be updated?