I need to populate a date on the case object that has the Last Activity date recorded. I tried to make a date formula on the case object, but cannot find the LastActivity API to pull it through. Is there another work around I need to do in order to get this date moved to the case?


Here are some threads on the topic. Options are custom Trigger code, Custom Process Builder "flow" which has to use an Invokable class method to update the Case, or the Rollup helper app from the app exchange which could rollup the latest activity Created Date for example to a field on the Case.




Please promote this idea https://success.salesforce.com/ideaView?id=08730000000ZeK2AAK

Create a trigger on Task to update LastActivityDate__c(Custom Date field on Case).

Here is pseudo code

    trigger UpdatedRelatedCase on Task(after Update){

    List<Case> lstCasesToUpdate = new List<Case>();

    for(Task newTask : Trigger.new){
            String.valueOf(newTask.WhatId).startsWith('005') &&
                new Case(
                    Id = newTask.WhatId,
                    LastActivityDate__c = Date.Today()

        UPDATE lstCasesToUpdate;

  • This is missing code, and would result in no change to the Case, it would not compile either as parentCase is undefined. You'd want a list of CasesToUpdate, and within the for loop add Cases with the updated Date stamp. Then an Update DML operation after the for loop. – Mike Katulka Jul 25 '16 at 21:31
  • I see pseudo code there, so my bad. Read my previous comment for those who would consider really implementing this. – Mike Katulka Jul 25 '16 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.