+ Start a Discussion
MATTYBMEMATTYBME 

Displaying an image if a checkbox is checked formula help

So I want to display a flag if a checkbox is checked. I have tried:

 

IMAGE(
IF(Account.Customization__c ,
"checkbox is checked","/img/samples/flag_red.gif"),
"")

 but the flag does not appear. If I try;

 

IMAGE(
IF(Account.Customization__c ,
"checkbox is unchecked","/img/samples/flag_red.gif"),
"")

 the flag appears.

 

What am I doing wrong. What is the right formula for displaying my red flag when the checkbox is checked please?

 

 

 

 

 


Message Edited by MATTYBME on 10-12-2009 07:55 AM
Best Answer chosen by Admin (Salesforce Developers) 
MATTYBMEMATTYBME

Thanks Stevemo. What I wanted to do was display a flag if the checkbox was checked (= TRUE). I ended up using this and it works perfectly:

 

IMAGE( IF(Account.Customization__c = True , "/img/samples/flag_red.gif",""), "")

 

 

 

All Answers

Steve MolisSteve Molis

Hi Matt,

 

I think you might just have to move your IMAGE statement to the inside of your IF statement. 

 

Here is one that I did on my SFDC Org to add an Alert Indicator to my Opportunity Page, you could probably hack out a line and use it for yours 

IF(AND(IsWon) , IMAGE( "/servlet/servlet.FileDownload?file=01540000000JaGp", "Green:Closed/Won"),
IF (AND(CloseDate < TODAY(),NOT(IsClosed)) , IMAGE( "/servlet/servlet.FileDownload?file=01540000000JaH4", "Red:Lapsed"),
IF (AND(CloseDate <= TODAY() + 15,NOT(IsClosed)) , IMAGE( "/servlet/servlet.FileDownload?file=01540000000JaGz", "Yellow:Close Date - 15 Days"),
IF (AND(CloseDate >= TODAY(),NOT(IsClosed)) , IMAGE( "/servlet/servlet.FileDownload?file=01540000000JaGu", "Blue:Open"),
IF(AND(IsClosed,NOT(IsWon)) , IMAGE( "/servlet/servlet.FileDownload?file=01540000000JaGv", "Grey:Closed/Lost"),null)))))

 


 

 

 

Message Edited by Stevemo on 10-12-2009 11:40 AM
MATTYBMEMATTYBME

Thanks Stevemo. What I wanted to do was display a flag if the checkbox was checked (= TRUE). I ended up using this and it works perfectly:

 

IMAGE( IF(Account.Customization__c = True , "/img/samples/flag_red.gif",""), "")

 

 

 

This was selected as the best answer
Tori Sansom 9Tori Sansom 9
HI

I have a checkbox "Pre-Approval Required" that gets updated from a field update. I need to create a formula field that shows a red flag if this is true otherwise a green flag will show.

I currently have this formula: 

IMAGE( IF(Pre_Approval_Required__c = True , "/img/samples/flag_red.gif",""), "")

It's working fine, but i'm not sure how to add the green flag condition 

Thank you