0

I am trying to display a green flag when Account status__c(status__c is a picklist field) is Active, else display red flag. I have written below in formula field, but I am getting error message as "Error: Field status__c is a picklist field. Picklist fields are only supported in certain functions". Please help.

IMAGE( 
Account( status__c, 
"Yes", "/img/samples/flag_green.gif",
"/img/samples/flag_red.gif" ), 
"Status Flag")

1 Answer 1

0

You cannot get value of the picklist field directly, you need to convert it into text first. Below code should work for you.

if(
  TEXT(status__c) == 'Yes',
  IMAGE("/img/samples/flag_green.gif", "Status Flag"),
  IMAGE("/img/samples/flag_red.gif", "Status Flag")
)
3
  • I would like to do this in apex as if(acc.status__c == 'Yes'){ acc.status__c = '/img/samples/flag_green.gif' + acc.status__c; } Commented Nov 4, 2019 at 11:03
  • Is it possible ? Commented Nov 4, 2019 at 11:03
  • Nope, why you want to go for apex if you can do this with the formula field? Commented Nov 4, 2019 at 11:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .