Recently, I worked on a new Resco implementation for one of our clients. During UAT, their end users saw a lot of possibilities with the Global Maps. Many of their users do a significant amount of traveling, visiting existing customers or working new leads. They really appreciate that they can look up a customer and see all of the other customers that are located nearby; then they can plan to make more stops because they will already be in the area.

In order to get the most out of the map, end users asked if we could display different colored map pins depending on fields on the account record. The specific request was to display different colors based on the combined values of two option sets. For example, if Option Set 1 = Value 1 and Option Set 2 = Value 1 display a blue pin, if Option Set 1 = Value 1 and Option Set 2 = Value 2 display a green pin, etc.

While researching online, I found this YouTube video. The video was created by Resco to explain Maps in Resco Mobile CRM. In the video Lukás Lesko explains many topics, including how to add a custom map pin based on the value of a single Option Set by passing the value of the option set to the map pin control of the view used on the map. This is a great solution assuming you only want to display dynamics pins based on a single option set. What if you want to display different pins based on a range of a currency field (like Annual Revenue), or a whole number field (like Number of Employees, or a combination of two option sets (like I was tasked to do)? Taking some inspiration from the aforementioned video, specifically the “Static Custom Map Pin” part, I came up with my own idea which worked out great and can be used for any criteria you can think of.

Solution:

  1. Source your map pin images.
    • In my case, I needed 6 different color map pins. Resco was nice enough to provide me with PNG files of the map pins that come with Resco by default, which was great since I would not have to worry about playing with the scale of the images (by the way they are 64 Pixels by 105 Pixels). I then copied the pins and recolored pixel by pixel in MS Paint until I had the 6 colors the users wanted. If you don’t want to have to create your own images, there are some websites online where you can buy different icons, including map pins, like ICONFINDER or your marketing department might be able to help you source your map pin images.
  2. Import your images into your Resco Project
    • There is a walkthrough in the Resco Webinar but the process is fairly simple.
      1. Open Woodford
      2. Navigate to Images
      3. **Optional. Click on Directories on the right, then New Directory. Make sure there are no spaces in your directory name
      4. Click Add
        • Select your Directory
        • Leave Platform as Common Images
        • Leave DPI XHDPI
        • Add a Name
        • Click on the symbol and find your image
          crm-and-resco-mobile-crm-using-dynamic-map-pins-1
        • Click add
  3. Open the view that is used for the Global Map
  4. Most of the time your view will only have 1 row, add a map pin the row. It should look something like this:
    crm-and-resco-mobile-crm-using-dynamic-map-pins-2
  5. Now clone this row as many times as needed. In my case I cloned the row 5 times, giving me a total of 6 identical rows.
  6. Click On crm-and-resco-mobile-crm-using-dynamic-map-pins-3and define the criteria which determines which row is used for each record. This step is where this approach is better than the one in the webinar since you can define pretty much any criteria. If you can define your criteria in an advanced find you should be able to replicate it here.
  7. Click through your rows and changed the map pin Binding to the image you want to use. In the screen shot above I am using the image that I added to my directory called CustomImages.customGreyPin.png
  8. Save and Publish

Now when you look at the Global Map in Resco, you will see that the map pin used for each record is the pin that you defined for the row that matches the criteria you specified in the Row Script. My previous blog post has a screen shot example showing four different dynamic pins on the Resco Global Map.

If you’ve been having any issues with the Resco Global Map zooming in, or your current location or map pins not displaying, take a look at my previous blog post.

For more information about getting the most out of your Microsoft Dynamics CRM solution, contact our experts at RSM 855-437-7202 or check out our Microsoft Dynamics Community News Publication.

by Steve Trefz for RSM