+ Start a Discussion
Lisa Lee-BanksLisa Lee-Banks 

Syntax for creating an image formula field

I need a red bar to appear when the following conditions are met on the record:
IF a checkbox value is true
OR
IF a date field is within 14 days of today AND a status field is a certain value.

This is what I have tried but the OR is giving me a syntax error.

IF(Checkbox = TRUE, IMAGE("/img/samples/color_red.gif ","red", 15,120),"blank")
OR(
IF( Date__c - TODAY() < 14,
IF(AND(ISPICKVAL( Status__c ,"Committed by client")),IMAGE("/img/samples/color_red.gif ","red", 15,120),"blank"))
Best Answer chosen by Lisa Lee-Banks
Santosh Kumar 348Santosh Kumar 348
Hi Lisa,

can you check now:
IF( OR(Checkbox = TRUE, AND(Date__c - TODAY() < 14, ISPICKVAL(Status__c , "Committed by client") )) ,  IMAGE("/img/samples/color_red.gif ", "red",15,120) , "blank")

If you still face any issue then do let me know.

Regards,
Santosh Kumar

All Answers

Santosh Kumar 348Santosh Kumar 348
Hi Lisa,

Try below syntax, 
IF( OR(Checkbox = TRUE, AND((Date__c - TODAY() < 14, ISPICKVAL( Status__c ,"Committed by client")))), IMAGE("/img/samples/color_red.gif ","red", 15,120),
"blank")

Please mark as Best Answer if above information was helpful.

Thanks,
Santosh Kumar
Lisa Lee-BanksLisa Lee-Banks
Thanks Santosh. The syntax error I'm getting is Error: Syntax error. Missing ')' *Lisa Lee-Banks* *Certified Salesforce Consultant* *604-908-9457* *Schedule a meeting *
Santosh Kumar 348Santosh Kumar 348
Hi Lisa,

can you check now:
IF( OR(Checkbox = TRUE, AND(Date__c - TODAY() < 14, ISPICKVAL(Status__c , "Committed by client") )) ,  IMAGE("/img/samples/color_red.gif ", "red",15,120) , "blank")

If you still face any issue then do let me know.

Regards,
Santosh Kumar
This was selected as the best answer
Lisa Lee-BanksLisa Lee-Banks
Thank you Santosh - this works perfectly. Have a great day!