0

We use an app to age our cases and I was wondering if I could build this out myself. I have created a Case Age field in my Dev Org which calculates the age of a case but it only updates the case based on the difference of Case creation and last modified date.

Whereas the app that we currently use calculates the time elapsed when you view the record or refresh the screen. You can see below that the Case Flag Age is showing 17 minutes and the case hasn't been modified since it was created.

Case Age from App

Here is the formula that I'm using to age my case in my Dev Org

    IF ( D2subD1__c > 0, 
TEXT(FLOOR( D2subD1__c)) & " days " & 
TEXT( FLOOR( 24 * ( D2subD1__c - FLOOR(D2subD1__c) ))) & " hours" & 
TEXT( ROUND(60 * (ROUND( 24 * ( D2subD1__c - FLOOR(D2subD1__c) ),8) - FLOOR( 
ROUND( 24 * ( D2subD1__c - FLOOR(D2subD1__c) ),8)) ),0)) & " mn " 
, "")

Where D2SubD1__c is just the difference between Modified and creation date.

LastModifiedDate - CreatedDate

Is this possible to do without writing a lot of code?

Many thanks

1

What you want to be subtracting the CreatedDate from is probably not the LastModifiedDate but the formula function NOW(), which returns the DateTime value of the present moment. Since formula values are calculated at the time they are accessed or rendered, this would yield the age of the case at the time of viewing, as you specify for the field provided by your application.

You could make this change in your D2SubD1__c formula by replacing LastModifiedDate with NOW().

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.