[SalesForce] How to i change the color of the case subject or any other field as per time for SLA

I am working to change the color of the case subject or any other field with respect to the time. I have tried the formula fields for same. But I am not sure how to change the color.

For Example, if there is task to be completed in 18 hours. I want this to appear normal, After 5 hours, the color for case statement should change to yellow, then after 15 hours it should change to blue. After 18 hours, it should change to Red.

Best Answer

In addition of already said by sfdcfox I would like to show you an example of the formula field that you should add.

  1. Add 3 images as statics resources and name them: yellowFlag, blueFlag, redFlag
  2. Add a custom field type formula and use this:

    IF( ( Now() - CreatedDate )*24 > 18 , IMAGE("/resource/RedFlag", "red" ,30, 30) , IF( ( Now() - CreatedDate )*24 < 15, IMAGE("/resource/BlueFlag", "blue" ,30, 30), IMAGE("/resource/YellowFlag", "yellow" ,30, 30)) )

Key points:

  • (Now() - CreatedDate) *24 == record's age in hours
  • IMAGE("/resource/YellowFlag", "yellow" ,30, 30)) == will show the image that set

Sample:

enter image description here

Related Topic