Formula field is not working in salesforce

176 Views Asked by At

I am creating a formula field on Lead object. If country of lead is one of the field from picklist value of high risk countries picklist field then show some image and text which i have stored in custom label and static resource.

Here is what I have tried.

IF(

CONTAINS(Country, TEXT(High_Risk_Countries__c)),

IMAGE ("/resource/HighRiskFlag","High Risk Country",15, 15)+''+
$Label.High_Risk_Country ,

NULL
)

But it is not working. Any help would be appreciated.

1

There are 1 best solutions below

0
eyescream On

Do you have a value in that High_Risk_Countries__c selected for this lead or is it blank and you just hope to somehow compare Country to all possible picklist values? You can do such comparison ("describe operations") in Apex or flows, not so much in pure formulas.

You could spell the countries out in the formula (CONTAINS(Country, 'AAA') || CONTAINS(Country, 'BBB') || ...) or maybe do something clever with a custom label... Or let me know if you'd like to try Apex trigger for it.