Mapping a Prospect List on SugarCRM

Recently added to the JJWDesign Google Maps package v2.1.8, is the base functionality to map a Prospect List (or Target List). This includes a combination of Prospects (Targets), Leads, Contacts and even Users as the legend groupings. The combination is appealing to many users. This is just the start of this mapping type functionality and is expected to be developed further in the future. Mapping of Campaigns is not possible at this time (11/21/2013).

Map a Prospect List by Record ID

A Prospect List (or Target List) can be mapped using the following parameters in your URL. This is the most simple way. All you need is the record id (UUID), which is available in the URL for the Prospect List.

index.php?module=jjwg_Maps&action=map_display&record=[id]

  • module: jjwg_Maps
  • action: map_display
  • record: The ‘id’ field value of the List record (UUID)

Example URL:

index.php?module=jjwg_Maps&action=map_display&list_id=6b19dc32-ff28-0295-bfa9-524b2f23ede6

Add a “Map” link to the Target Lists – List View

You may also decide to add a “Map” link to the Target Lists – List View. This is a bit more difficult to accomplish.

Steps to Add Map Link for Target Lists – List View:

Studio does not allow you to edit Target Lists in SugarCRM CE (v6.5). I’m not certain why. For some reason, I can not get this simple URL into the listing view. I’ll explain the process, but I can’t know if it will work with all versions of SugarCRM. So, in this case, I would highly suggest making a full backup (Files and MySQL) before proceeding.

To enable the Target LIsts in Studio:

Create an empty script/file in modules/ProspectLists/metadata/studio.php. This will enable the module in Studio. Then go to Admin -> Studio -> Target Lists. Add a New Field:

  • New Field -> Data Type “URL”
  • Call it the “map” field, and Label as “Map”
  • Generate URL (checked)
  • Default Value: ./index.php?module=jjwg_Maps&action=map_markers&list_id={id}  (Or use the full path URL)
  • Save

Go to List View:

  • Pull the “Map (map_c)” field over into the “Default” section for the List View.
  • Save and Deploy

You would think that this would work, but it doesn’t display any values on SugarCRM CE. It does create the column in the List View. So, instead, we must use some Custom Code in the List View file to display the URL. This requires a file edit, not readily available in SugarOnDemand instances.

Open the meta data file for the Prospect Lists – List View.

custom/modules/ProspectLists/metadata/listviewdefs.php

File the ‘MAP_C’ array section. Edit to add the ‘custom_code’:

‘customCode’ => ‘<a href=”./index.php?module=jjwg_Maps&action=map_display&list_id={$ID}”>’.$GLOBALS[‘mod_strings’][‘LBL_MAP’].'</a>’, 

That will create the “Map” link. For example:

<a href=”./index.php?module=jjwg_Maps&amp;action=map_display&amp;list_id=f001b013-083a-69e3-68b1-52839b8510f7″>Map</a>

When you’re done, remove the empty file in modules/ProspectLists/metadata/studio.php to disable the Studio functionality (if necessary). I know it’s a long process, just for a simple link, but it does work. If you need help implementing the Target Lists URL links, please let me know. Support services are available.

1 thought on “Mapping a Prospect List on SugarCRM”

Leave a Comment