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
Alex Christensen 1Alex Christensen 1 

Encountering the Error, The formula expression is invalid: Syntax error. Extra ',' What am I missing here?

The process builder is mapping the RMA field over to a text field on the case. This is the conditional formula portion but will not save due to the error. 

OR(ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Power"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "No Communication (CCM)"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Software"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Assembly defect"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Abuse"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "No problem found"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Other" ), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Connectivity"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Customer Induced Defect (CID)"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "NTF"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Sound"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "OEM"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "TBD")), AND($User.Department <> "Accounting"), AND($Profile.Name <> "CG System Administrator"), AND($Profile.Name  <> "System Admin - Custom")))
 
Best Answer chosen by Alex Christensen 1
ravi soniravi soni
hi alex, 
try this following formula
AND(
OR(
ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Power"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "No Communication (CCM)"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Software"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Assembly defect"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Abuse"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "No problem found"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Other" ), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Connectivity"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Customer Induced Defect (CID)"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "NTF"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Sound"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "OEM"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "TBD"), 
AND($User.Department <> "Accounting")
), 
$Profile.Name <> "CG System Administrator", 
$Profile.Name  <> "System Admin - Custom"
)

I think it should be in this form but still if it's not works then please let me know about your requirment I will try to fix.
and if it's works then mark best for it.
Thank you

All Answers

SwethaSwetha (Salesforce Developers) 
HI Alex,
Can you try swapping the values as mentioned in https://trailblazers.salesforce.com/answers?id=9063A000000idQJQAY and see if that fixes the issue? Thanks
ravi soniravi soni
hi alex, 
try this following formula
AND(
OR(
ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Power"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "No Communication (CCM)"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Software"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Assembly defect"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Abuse"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "No problem found"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Other" ), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Connectivity"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Customer Induced Defect (CID)"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "NTF"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "Sound"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "OEM"), ISPICKVAL([Opportunity].RMA_Root_Cause__c, "TBD"), 
AND($User.Department <> "Accounting")
), 
$Profile.Name <> "CG System Administrator", 
$Profile.Name  <> "System Admin - Custom"
)

I think it should be in this form but still if it's not works then please let me know about your requirment I will try to fix.
and if it's works then mark best for it.
Thank you
This was selected as the best answer