function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Brian McDonaldBrian McDonald 

Limit Case Flag to a specific picklist values

I would like to limit case flags to specific picklist values.  I continue to receive this error.

Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 2

IF(
NOT(ISPICKVAL(Origin, "Phone")),
IMAGE( 
CASE(Partner_Name__c, 
"Experian Health", "/img/samples/flag_red.gif",
"Cerner Corporation", "/img/samples/flag_red.gif",
"Patientco", "/img/samples/flag_yellow.gif",
"Pelitas", "/img/samples/flag_yellow.gif",
"/s.gif"), 
"Partner Flag"))
PriyaPriya (Salesforce Developers) 
Hey Brian,

The error seems to be because of putting the closing bracket ' ) ' of IMAGE command at the end. I have corrected it. 

kindly try this below :-
IF(
NOT(ISPICKVAL(Origin, "Phone")),
IMAGE( 
CASE(Partner_Name__c, 
"Experian Health", "/img/samples/flag_red.gif",
"Cerner Corporation", "/img/samples/flag_red.gif",
"Patientco", "/img/samples/flag_yellow.gif",
"Pelitas", "/img/samples/flag_yellow.gif",
"/s.gif")), 
"Partner Flag")
 

Kindly mark it as the best answer if it works for you.

 

Thanks & Regards,

Priya Ranjan


 
Brian McDonaldBrian McDonald
Thanks Priya, but I receieved the same Error: Incorrect number of parameters for function 'IMAGE()'. Expected 2, received 1
Do I need an "OR" statement?
Brian McDonaldBrian McDonald
The original formula I have is working, but I now need to not include the "Flag" image on case object with an Origin of "Phone"
{Original Formula Field}

IMAGE( 
CASE(Partner_Name__c, 
"Experian Health", "/img/samples/flag_red.gif",
"Cerner Corporation", "/img/samples/flag_red.gif",
"Patientco", "/img/samples/flag_yellow.gif",
"Pelitas", "/img/samples/flag_yellow.gif",
"/s.gif"), 
"Partner Flag")
PriyaPriya (Salesforce Developers) 
Hey Brian,

Actually in the IF statement, there are 3 parameters like below :-

IF(logical_test, value_if_true, value_if_false)

Checks whether a condition is true, and returns one value if TRUE and another value if FALSE.

In the formula you have providied you are passing only 2 parameter. logical test and the value if true but not passing the third one i.e.,  value if false.
 
IF(
NOT(ISPICKVAL(Origin, "Phone")),
IMAGE( 
CASE(Partner_Name__c, 
"Experian Health", "/img/samples/flag_red.gif",
"Cerner Corporation", "/img/samples/flag_red.gif",
"Patientco", "/img/samples/flag_yellow.gif",
"Pelitas", "/img/samples/flag_yellow.gif",
"/s.gif"), 
"Partner Flag"),.....Value if false....)


pass the third parameter in the blank space.

Thanks & Regards,

Priya Ranjan
 

Brian McDonaldBrian McDonald
I'm not sure I understand