You need to sign in to do that
Don't have an account?
Case statement with picklist expression giving error
In the following case, the field CalendarAvailability__c is a picklist field and Closed, Tenative, & Open are the fields values. I'm trying to have an image displayed in a formula field based on the value of that field but am receiving the following error on save:
Error: Syntax error. Missing ')'
But as far as I can tell my Case statement seems to be formatted properly ... what am I missing ...?
CASE
(
CalendarAvailability__c,
'Closed',
IMAGE('/img/samples/color_red.gif', 'Closed' [, 25, 100]),
'Tenative',
IMAGE('/img/samples/color_yellow.gif', 'Tenative' [, 25, 100]),
'Open',
IMAGE('/img/samples/color_green.gif', 'Open' [, 25, 100]),
' '
)
Those bracket things are just doc artifacts to indicate that those parameters are optional. You shouldn't actually put them in your formula. This should work then:
CASE
(
CalendarAvailability__c,
'Closed',
IMAGE('/img/samples/color_red.gif', 'Closed' , 25, 100),
'Tenative',
IMAGE('/img/samples/color_yellow.gif', 'Tenative' , 25, 100),
'Open',
IMAGE('/img/samples/color_green.gif', 'Open' , 25, 100),
' '
)
All Answers
Those bracket things are just doc artifacts to indicate that those parameters are optional. You shouldn't actually put them in your formula. This should work then:
CASE
(
CalendarAvailability__c,
'Closed',
IMAGE('/img/samples/color_red.gif', 'Closed' , 25, 100),
'Tenative',
IMAGE('/img/samples/color_yellow.gif', 'Tenative' , 25, 100),
'Open',
IMAGE('/img/samples/color_green.gif', 'Open' , 25, 100),
' '
)