Tracking Activity History

22 Acacia Avenue…

For a recent client demo, I needed to build a dashboard that would identify key accounts/contacts that hadn’t been contacted recently. Although all the activity data needed is in the CRM database, it’s not easy to consume within a dashboard.

For example, suppose I wanted a chart of contacts who had not had a phone call in the last 3 months, segmented by role. I couldn’t find a way to display this out of the box. Luckily, with a small amount of configuration and customisation, I was able to solve the problem. The screenshot below is a dashboard showing the 6 main activity types (appointment, e-mail, fax, letter, phone call and service appointment) by role (decision make, influencer, employee).

Contact Activity History

To create this I first configured 6 additional fields on the contact entity in order to track the last activity date of the main activity types (appointment, e-mail, fax, letter, phone call and service appointment). Then I configured 6 views to identify contacts who had not been contacted in the last 3 months, one view for each activity type. Next I configured 6 charts, one for each activity type, to show activity by role. Finally, i configured a new dashboard to display each chart, filtered by the relevant view.

Now, all that is left to do update the new fields on a contact record whenever they participate in an activity. This is where we need a little “plug-in” magic. I created a plug-in that would execute on the SetStateDynamicEntity event for each of the main activity types. The plug-in loops through each PartyList field (To, From, Cc, Bcc, Organizer, Required Attendees, Optional Attendees etc.), and every time it finds a CRM contact, it updates the appropriate last activity date field for that contact. All fairly simple really. Just one note of caution, in large CRM deployments you might have a lot of activity tracking going on, which means the plug-in gets fired a lot. In order to reduce the likelihood of performance issues, I chose to trigger the plug-in on Asynchronous events.

If you want to try this out, I have packaged up my solution (both managed and unmanaged solution packages) and made it available for download here. The solution package contains the following:

  • A modified contact entity containing 6 new fields, 6 new charts and 6 new views. I have not updated any of the out-of-the-box forms or views, so this won’t overwrite any customisations you have made to the contact entity.
  • A plug-in to handle the SetStateDynamicEntity event on the 6 main activity types (appointment, e-mail, fax, letter, phone call and service appointment).
  • A dashboard to display the 6 new charts.

In addition, I have included the source code for the plug-in, as well as an Excel spreadsheet containing some sample contact data that you can use to test the solution. Using the same solution, and adding some multi-series charts (see the CRM product group blog for more details - CRM 2011 Charts – Know the Real Potential ~ Part I), here’s an example of a slightly more complex dashboard I put together for another demo.

Contact Activity History 1

This posting is provided "AS IS" with no warranties, and confers no rights.

Laughing Boy Chestnuts Pre-School Chain Gang


Comments (1)

  1. Laurence says:

    Excellent article

Skip to main content