Setting Up Follow-Up E-Mails in Dynamics CRM
In this post I will describe a solution to add Microsoft Office Outlook style functionality to follow-up e-mails. In Microsoft Office Outlook, you can mark an e-mail as read/un-read, and you can also mark the e-mail for follow-up with various scheduling options (today, tomorrow, next week, custom date) and finally mark complete. We’ll see how we can make customization and add similar functionality in CRM as well.
The idea behind the solution is to track the activity action history, i.e. we want to keep track of when an action was performed. Whether it was opened, marked read/un-read or marked for follow-up or completed.
Let’s start by creating a new entity “Activity Action History” in Dynamics CRM with the following attributes.
Next we’ll customize the form ribbon on the e-mail entity. We’ll add 4 ribbon buttons as shown below.
We will add commands for each ribbon button and add JavaScript functions as actions. The main function is createActivityActionRecord. In this function we are checking the form type, we only want to enable the buttons or have any “activity action” performed when the form is not opened for creating a new e-mail. We want to track activity action for e-mails that we’ve sent or received in the system.
The first step we want to take is to deactivate any of the older “Activity Action History” records. For example, let’s say we open an e-mail for the first time, an activity action history gets created, and then we mark it as read. What we would like to see is the last action performed while still maintaining the action history performed on the e-mail record. We will see later in the blog post how we’re going to leverage this to create views and dashboard.
Next, we are checking if the e-mail was opened for the first time, if it is, then we create an activity action history record with e-mail opened as the action. We don’t want to create an e-mail opened action record again and again as it serves no purpose.
Next up we’re initializing the object to be created by setting in the proper values and then we are creating the object using the REST (OData) endpoint of CRM. We will be using the XrmServiceToolkit for this purpose. The same process applies for ‘Mark As Un-Read’ and ‘Mark Completed’ options.
When the user clicks on the Follow-Up Flyout menu and selects Custom Date, there will be a pop-up allowing the user to select a date in the future. For all follow-up date actions, we set the date on the Activity Action History object.
Following is a dashboard of all the views showing e-mails that have been opened, marked as read, marked as un-read, marked for follow-up or marked completed.
Hope you like this feature for Dynamics CRM!
Please contact FMT Consultants at 760.930.6400 for assistance or more information about Dynamics CRM.