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")
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")
)
  • 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; } – SFDC Learner Nov 4 at 11:03
  • Is it possible ? – SFDC Learner Nov 4 at 11:03
  • Nope, why you want to go for apex if you can do this with the formula field? – rahul gawale Nov 4 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.