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
David_GBDavid_GB 

Metrics formula with image

I'm tring to write a formula that calculates the age of a case based on it's priority as defined by TL9000 standards for Fix Response Time (FRT).
 
Here's the formula that I put together and the it passed the checked syntex but fails to issue a "flag".
 
IMAGE( CASE ( Priority,
"P2 (Major)", Age__c, "720", "/img/samples/flag_red.gif",
"P3 (Minor)", Age__c, "4320", "/img/samples/flag_red.gif",
"P1 (Critical)", Age__c, "24", "/img/samples/flag_red.gif",
"/s.gif"),
"Priority Flag"
 
I've even considered doing a stop light so if the case age is for the priority is below the required time it would have a green light. When the work around time expires it would change to yellow and then when the Fix response time (final fix) expires it would then change to red.

I already have work flow rules in place to trigger emails around these guidelines and now I'm just trying to put a cosmetic layer to the page layout.
 
Any idea's?
HerosHeros
Try seeing if the following works for you:

Code:
IMAGE(  
     IF( AND (Case_Age__c = 1,   ISPICKVAL( Priority , "Low") ), "/img/samples/flag_green.gif", 
     IF( AND (Case_Age__c = 2,   ISPICKVAL( Priority , "Medium") ), "/img/samples/flag_yellow.gif",
     IF( AND (Case_Age__c = 3,   ISPICKVAL( Priority , "High") ), "/img/samples/flag_red.gif",
     "/s.gif"
))),"Formula Flag")

You will want to change some of the stuff here but this should do what you want. If not let me know.

 

David_GBDavid_GB
Slight modifications based on our setup but in all scenerio's it fails on "age__c" because it expects text vs a number. I can trigger this images solely off of age__c but not age + priority. Still working on it. We have excalation rules in places that does the same thing for sending out email notification based on the same parameters but so the logic is in SFDC.
 
IMAGE( 
    IF( AND (Age__c >= 24,   ISPICKVAL( Priority , "P1 (Critical)") ), "/img/samples/flag_red.gif",
    IF( AND (Age__c >= 720,   ISPICKVAL( Priority , "P2 (Major)") ), "/img/samples/flag_red.gif",
    IF( AND (Age__c >= 4320,   ISPICKVAL( Priority , "P3 (Minor)") ), "/img/samples/flag_red.gif",
    "/s.gif"
))),"Formula Flag")
David_GBDavid_GB
This is the formula that's working now to display the status color. A few minor changes but this is good to use. Note: TL9000 (www.questforum) only reports against Major and Minor, we've included Critical and will include other Priority (TL9000 is severity) for internal auditing.
 
IMAGE( CASE ( Priority,
              "P1(Critical)", IF((NOW() - CreatedDate) * 24 >= 24, "/img/samples/light_red.gif", "/s.gif"),
              "P1 (Critical)", IF((NOW() - CreatedDate) * 24 <= 4, "/img/samples/light_yellow.gif", "/s.gif"),
              "P1 (Critical)", IF((NOW() - CreatedDate) * 24 <  24, "/img/samples/light_green.gif", "/s.gif"),
              "P2 (Major)", IF((NOW() - CreatedDate) * 24 >=  30, "/img/samples/light_red.gif", "/s.gif"),
              "P2 (Major)", IF((NOW() - CreatedDate) * 24 >=  15, "/img/samples/light_yellow.gif", "/s.gif"),
              "P2 (Major)", IF((NOW() - CreatedDate) * 24 <    15, "/img/samples/light_green.gif", "/s.gif"),
              "P3 (Minor)", IF((NOW() - CreatedDate) * 24 >=  180, "/img/samples/light_red.gif", "/s.gif"),
              "P3 (Minor)", IF((NOW() - CreatedDate) * 24 >=  90, "/img/samples/light_yellow.gif", "/s.gif"),
              "P3 (Minor)", IF((NOW() - CreatedDate) * 24 <    90, "/img/samples/light_green.gif", "/s.gif"),
              "/s.gif"),
"Status Color")
David_GBDavid_GB

Final Formula - works/looks great!

IMAGE(CASE(Priority,

          "P1 (Critical)", IF((NOW() - CreatedDate) * 24 >= 24, "/img/samples/light_red.gif",

                              IF((NOW() - CreatedDate) * 24 >= 4, "/img/samples/light_yellow.gif",

                                  IF((NOW() - CreatedDate) * 24 < 4, "/img/samples/light_green.gif", "/s.gif"))),

 

          "P2 (Major)",    IF((NOW() - CreatedDate) * 24 >= 30, "/img/samples/light_red.gif",

                              IF((NOW() - CreatedDate) * 24 >= 15, "/img/samples/light_yellow.gif",

                                  IF((NOW() - CreatedDate) * 24 <  15, "/img/samples/light_green.gif", "/s.gif"))),

 

          "P3 (Minor)",    IF((NOW() - CreatedDate) * 24 >= 180, "/img/samples/light_red.gif",

                              IF((NOW() - CreatedDate) * 24 >= 90, "/img/samples/light_yellow.gif",

                                  IF((NOW() - CreatedDate) * 24 <  90, "/img/samples/light_green.gif", "/s.gif"))),

 

          "/s.gif"),

 

"Status Color")