I can't really tell what exactly you're trying to do here, but assuming that the formula would be semantically correct if the syntax errors were fixed... it'd look like this
IF(
ISPICKVAL(central__c, 'APEX'),
/* Strings need to be enclosed in quotes (either single or double quotes, not */
/* "smart" quotes) */
/* You also need a comma after each argument */
'0Y209000000TcxiCAC',
/* The way to do an if-else in a formula is to nest another IF() in the 3rd argument */
IF(
ISPICKVAL(central__c, 'INDEPENDANT'),
'0Y209000000TcybCAC',
/* IF() requires 3 arguments, no more, no less */
null
)
)
Note the placement and usage of closing parenthesis and commas. Close paren ends a function (or a logical grouping like 2 * (3 + 4)
for specifying the order of evaluation). Commas are used between arguments to a function.
While that should be syntactically correct, that's a rather obtuse way to test a single field against multiple values. A better choice here would be the CASE()
function.
CASE(
/* The first argument is always the expression to match the values listed below against */
/* CASE() is also one of the few things that can work on picklists directly */
Central__c,
/* Next up, value - result pairs */
'APEX', '0Y209000000TcxiCAC',
'INDEPENDANT', '0Y209000000TcybCAC',
/* Finally, the result to yield if there are no value matches */
null
)
I've included extra blank lines here in the hope that it makes things easier to read.
)
, your id values are not enclosed in quotes, yourIF()
functions are missing their third parameter, you're missing a few commas), but it's not entirely clear what you intend for this formula to do. I'll give my best shot at an answer, but realize that the more details you include the more accurate the answers you'll tend to receive.Independant
is misspelled -Independent
is correct; if you have the chance to fix this before it gets into PROD, now's the time