« More good news about Microsoft CRM 4.0 Workflow | Main | Using the Microsoft Dynamics 4.0 Import Utility »
January 24, 2008
TrackBack
TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e54fb34b6f883300e5500641dd8834
Listed below are links to weblogs that reference Capturing Last Activity Date in Microsoft CRM 4.0:
Comments
Verify your Comment
Previewing your Comment
This is only a preview. Your comment has not yet been posted.
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.

Just one Comment
Prior to updating the Regarding Entity I would check for a field on that entity containing data (e.g. CreatedOn)
By peforming this check you avoid the workflow rule waiting if for instance a phone call is made against another entity than the one you are updating
Posted by: John Ball | April 02, 2008 at 11:52 AM
Suppose my phone call involves 2 people? The regarding field can only hold one name... how do I update the other contact?
Posted by: Al | July 11, 2008 at 03:01 PM
Al,
Good question--you can only set an activity regarding one contact. You can specify multiple contacts in the recipient field; however, you cannot update the contact based on them being in the activity recipient field.
You could, however, do it with a report. Basically you would need to join filteredactivityparty to contact id to get the list of activities that the contact is a recipient in, and also join it to FilteredActivityPointer and select either the Max(createdon) or Max(modifiedon) to get the most recent activity date.
Customer Effective can assist with custom reporting for Microsoft Dynamics CRM. Visit our web site at http://www.customereffective.com/index.asp?n=14&p=0&s=14 for contact information.
Posted by: Joel Lindstrom | July 11, 2008 at 11:28 PM
This is a very helpful and simple to use workflow. I was able to get the Last Activity Date field working okay for Contacts, but I cannot seem to figure out how to create the workflow to work for Accounts also.
Can you please start me off in the right direction? Thanks!
Hann
Posted by: Hann | October 16, 2008 at 04:07 PM
What I would do is also create a last activity date field on the account and make a workflow that runs on update of the contact last activity field that updates the last activity field on the account with the date from the contact. This will roll the date from contact to the account.
Then do a workflow like the contact workflow with a check condition steps to see if activity the accountid contains data and if so, update the account last activity field.
Posted by: Joel Lindstrom | October 16, 2008 at 11:27 PM
Thank you so much! That worked perfectly :)
Posted by: Hann | October 20, 2008 at 03:17 PM
Hi,
I'm hoping you can help. I've set up the Last Activity date attribute, put it on the contact form and created the workflow as described. The workflow succeeds but the field does not get updated on the form. It should be SO simple and it is driving me crazy! (Possible hint...the "regarding contact" does not show any workflow against it)
Any ideas?
Posted by: Karen | April 24, 2009 at 12:24 PM
OK, so just to confirm, your workflow is set to run against an activity entity (phone call, email, task, etc) upon create of the record and update the last activity date on the regarding contact, right?
Also, you are including the contact in the regarding field? It doesn't work if the contact is just a recipient.
The regarding contact would not show any workflow against it--the workflow is running against the activity.
Posted by: Joel Lindstrom | April 24, 2009 at 12:36 PM
This post was very helpful for appointments and phone calls. However, one hurdle I am trying to overcome is that emails do not have the regarding set by default. Ideally, emails would automatically trigger the workflow and update the lead/contact. This becomes tricky when you must set the regarding properly before sending the email, and you have to set the regarding to the lead/contact you want to update (an email to a lead regarding a product wont update the lead).
Any ideas to help improve emails updating the Last Activity Date?
Posted by: Kenny | August 13, 2009 at 01:12 PM
If you want to update Last Activity Date when an email merge occurs, it works but runs very slowly. An email merge that used to takes minutes now takes hours to complete! Any thoughts on why this is slow?
Posted by: Alex Nosiara | September 21, 2009 at 01:31 AM
Alex,
I suspect what you are running up against is a bottleneck in the asynchronous processing service. Both workflows and direct email use the asynchronous processing service, and if you are doing a bulk email to hundreds or thousands of people, there will be a large number of workflows and emails in the pipe. Before you had just the direct emails going out, now for each one you have an email and a workflow.
The good news is that this is scalable--you can do things like load balancing multiple crm servers, or if you have the enterprise version, separate the asynchronous service on its own server to increase the speed of the asynchronous processing service.
Or you could look at a different way of determining last activity date, such as a SSRS report.
Posted by: Joel Lindstrom | September 21, 2009 at 08:21 AM
What do you do with PhoneCalls created by campaigns?
The regarding would no long then be a Contact?
Posted by: David | June 26, 2012 at 07:18 PM
good question David. Campaign e-mails are not set regarding contacts, they are set regarding the campaign. So no, this approach would not be optimal if you have a lot of campaign e-mails and want to update a last activity date on the contact.
What I would do if that is your scenario is to do a SQL query that joins the activitypointer to activity party and gets the last activity per contact (since activityparty would include the e-mails where the contact is a recipient but not the regardingobject). Then I would have a data update job using scribe, SSIS, import utility, or some other data update tool, update the contacts with the last activity date.
Posted by: Joel Lindstrom | June 26, 2012 at 09:59 PM