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.

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

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

  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; } Nov 4 '19 at 11:03
  • Is it possible ? Nov 4 '19 at 11:03
  • Nope, why you want to go for apex if you can do this with the formula field? Nov 4 '19 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.