You need to sign in to do that
Don't have an account?

QUESTION - Case LAST ACTIVITY
Hello, I have a question that I thought somebody on here might be able to help me with. Let me preface this by saying that I am completely new to Apex/Trigger coding in SF and how it is set up. But I AM able to see code already constructed and decipher how it is working (I have some programming backgroung but no Apex/SF specific coding background). Anyhow, to the question. I am trying to create a field that will list the "Last Activity" for a case. This is available already on Contacts and Accounts (I believe) but not on Cases. I am sure I am not the first to deal with this issue and I am also pretty sure that the trigger for this would be very general (i.e. not Org specific) and the only differences might be what one would call an "Activity". I really only want it to reflect the same as it does on a contact in regards to e-mails sent and received that are related to a specific case. If someone could provide me with a set of basic trigger code for this I would be much obliged. Also, I assume the trigger would reside on the activities object, correct? Thanks in advance!
Jeremy Stender
bump
Stebder - Any luck with this? I am looking for the same thing. We need Last Activity on Cases and then I want to set up notification emails for any cases that are not updated or no activity (last activity) in 7 days. I'm curious if you ever resolved this.
Thanks!
Hi Lizks,
I went through this before I was an actual developer (have since become MUCH more of a developer) but I was able to find and edit a trigger that has worked for us.
The code below is written to work for lot of different objects, but I have it commented out so that it will only fire when tasks related to Cases are created. (with letters telling me where the {} opened and closed, as this was before I had eclipse). You'll see that you need to have a Date/Time field on cases with the API name Last_Activity_Datetime__c to make this work.
Just plop this on a trigger and it should work:
Hope that helps,
Jeremy Stender
Thanks so much for this! I am slowly teaching myself how to write Triggers and Vf, but when I start from scratch it takes me forever! I really appreciate the prompt reply and code share. I'm trying this out now...