function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bryn JonesBryn Jones 

LastActivityDate for Specific Subject

I am trying to calculate the Last Activity Date for an activity that has a certain subject. For example: If John calls Mary on Jan 15 with the subject as a Follow Up and then calls Mary again on Jan 20 with the subject as Closing, I want my field to tell me that the last time John completed an activity as a Follow Up is Jan 15 not Jan 20 as the LastActvityDate formula would return.

Please help. I am thinking it would be IF(subject = Follow Up, LastActivityDate, NONE), but dont think it will work.
SonamSonam (Salesforce Developers) 
This can be achieved through a trigger on task object - the trigger will check to see if the task has Followup on the subject and update the LastActivityDate field on the contact. Custom code is available on the thread on link below 
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AWTOIA4