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
AndyuxAndyux 

salesforce formula IF TRUE

This works fine
IF(CONTAINS("VS:BJ", Owner.Alias), "Legacy", 
IF(ISBLANK(BillingState), "International", 
IF(CONTAINS("WA:OR:CA:AZ:NV:IDMT:WY:UT:CO:NM:TX:OK:KS:NE:WY:NE:SD:ND:MN:IA:MO:AR:LA:WI:IL", BillingState), "USA - West", 
IF(CONTAINS("AB:BC:MB:NT:NU:SK:YT", BillingState), "CAN - West", 
IF(CONTAINS("DC:OH:MI:IN:KY:TN:MS:AL:GA:FL:SC:NC:VA:WV:PA:PA:NY:ME:ME:VT:NH:MA:RI:CT:NJ:DE:DE:MD", BillingState), "USA - East", 
IF(CONTAINS("NB:NL:NS:ON:PE:QC", BillingState), "CAN - East", 
"International"))))))
But i need to first evaluate a Checkboxf field.If its TRUE, then should be done, otherwise, continues.  So when I add (first line)
IF(Global_Key_Account__c="TRUE"), "Global",
IF(CONTAINS("VS:BJ", Owner.Alias), "Legacy", 
IF(ISBLANK(BillingState), "International", 
IF(CONTAINS("WA:OR:CA:AZ:NV:IDMT:WY:UT:CO:NM:TX:OK:KS:NE:WY:NE:SD:ND:MN:IA:MO:AR:LA:WI:IL", BillingState), "USA - West", 
IF(CONTAINS("AB:BC:MB:NT:NU:SK:YT", BillingState), "CAN - West", 
IF(CONTAINS("DC:OH:MI:IN:KY:TN:MS:AL:GA:FL:SC:NC:VA:WV:PA:PA:NY:ME:ME:VT:NH:MA:RI:CT:NJ:DE:DE:MD", BillingState), "USA - East", 
IF(CONTAINS("NB:NL:NS:ON:PE:QC", BillingState), "CAN - East", 
"International"))))))
I get Error: Syntax error. Extra ','
Reading up on different formatting but cant get it! thanks-
Best Answer chosen by Andyux
Sure@DreamSure@Dream
Hi Andyux,

Your first line should be:
IF(Global_Key_Account__c="TRUE", "Global",
There was an unncessary ')' in the first line. 

End the last line of the formula with ")".

Mark this as the solution, if it solves your problem.

Thanks
 

All Answers

AndyuxAndyux
Please ignore <b> </b>, I bolded the new code...
Sure@DreamSure@Dream
Hi Andyux,

Your first line should be:
IF(Global_Key_Account__c="TRUE", "Global",
There was an unncessary ')' in the first line. 

End the last line of the formula with ")".

Mark this as the solution, if it solves your problem.

Thanks
 
This was selected as the best answer
AndyuxAndyux
Perfect thanks. Just had to remove "" froom true