+ Start a Discussion
janeisaacjaneisaac 

Stubborn comma error message

I can't figure out why I am getting an Extra comma message referring to the comma after (ISPICKVAL(Status__c,"Done Not Reviewed"))))

 

 

(IF(OR
(AND(Question_Group__c = "A",Answer__c = "Yes"),
(AND(Question_Group__c = "C",Answer__c = "No")),
(AND(Question_Group__c = "B",Answer__c <> " "))),
(ISPICKVAL(Status__c,"Done Not Reviewed")))),"https://c.cs2.content.force.com/servlet/servlet.FileDownload?file=015R00000001kLA",
NULL))

Best Answer chosen by Admin (Salesforce Developers) 
Steve MolisSteve Molis

Okay I think this is what you need: 

 

IF(
OR(
AND(Question_Group__c = "A", Answer__c = "Yes", ISPICKVAL(Status__c,"Done Not Reviewed")),
AND(Question_Group__c = "C", Answer__c = "No", ISPICKVAL(Status__c,"Done Not Reviewed")),
AND(Question_Group__c = "B", NOT(ISBLANK(Answer__c)), ISPICKVAL(Status__c,"Done Not Reviewed"))),
"https://c.cs2.content.force.com/servlet/servlet.FileDownload?file=015R00000001kLA", NULL)

 

All Answers

janeisaacjaneisaac

I keep trying but no luck:

 

For instance, this is a working formula

 

(IF(OR

(AND(Question_Group__c = "A",Answer__c = "Yes"),

(AND(Question_Group__c = "C",Answer__c = "No")),

(ISPICKVAL(Status__c,"Done Not Reviewed"))), "https://c.cs2.content.force.com/servlet/servlet.FileDownload?file=015R00000001kLA", NULL))

 

But when I add one more to the OR

 

(IF(OR

(AND(Question_Group__c = "A",Answer__c = "Yes"),

(AND(Question_Group__c = "C",Answer__c = "No")),

(AND(Question_Group__c = "B",Answer__c <> " "))),

(ISPICKVAL(Status__c,"Done Not Reviewed"))), "https://c.cs2.content.force.com/servlet/servlet.FileDownload?file=015R00000001kLA", NULL))

 

The error first tells me I am missing a Close Parenthes at the end of the BOLD item.

When I add the parenthes, it then tells me I have an extra comma at the end of it.

But you need the comma to tell it what to enter into the field.

 

Can someone take a look and see if you can figure it out?

 

Thanks,

Jane

TechTrackerTechTracker

It might help you...

 

IF(OR
(AND(Question_Group__c = "A",Answer__c = "Yes"),
(AND(Question_Group__c = "C",Answer__c = "No")),
(AND(Question_Group__c = "B",Answer__c <> " ")),
(ISPICKVAL(Status__c,"Done Not Reviewed"))),
"https://c.cs2.content.force.com/servlet/servlet.FileDownload?file=015R00000001kLA",
NULL
)

RovRov

Try this  - 

 

(IF(OR
(AND(Question_Group__c = "A",Answer__c = "Yes")),
(AND(Question_Group__c = "C",Answer__c = "No")),
(AND(Question_Group__c = "B",Answer__c <> " ")),
(ISPICKVAL(Status__c,"Done Not Reviewed")),"https://c.cs2.content.force.com/servlet/servlet.FileDownload?file=015R00000001kLA", NULL)

janeisaacjaneisaac

Not yet,

 

I tried it and first got an error saying it needed another close parenthese at the very end. I added it and got a Boolean error message:

 

(IF(OR
(AND(Question_Group__c = "A",Answer__c = "Yes")),
(AND(Question_Group__c = "C",Answer__c = "No")),
(AND(Question_Group__c = "B",Answer__c <> " ")),
(ISPICKVAL(Status__c,"Done Not Reviewed")),"https://c.cs2.content.force.com/servlet/servlet.FileDownload?file=015R00000001kLA", NULL))

 

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

Steve MolisSteve Molis

How about?

IF(
OR(
AND(Question_Group__c = "A", Answer__c = "Yes"),
AND(Question_Group__c = "C", Answer__c = "No"),
AND(Question_Group__c = "B", NOT(ISBLANK(Answer__c))),
ISPICKVAL(Status__c,"Done Not Reviewed")),
"https://c.cs2.content.force.com/servlet/servlet.FileDownload?file=015R00000001kLA", NULL)

 

janeisaacjaneisaac

Not Quite.

 

It works for True, but it does not work for False. The field should be empty if it is false. I tried it on a Question where the Question Group was "A", the Answer was "No" and the Status was "Done Not Reviewed". HOwever, if I changed the Status to "Not Done" the field was empty. So it is appears to be hingeing on the Status...

Steve MolisSteve Molis

Okay I think this is what you need: 

 

IF(
OR(
AND(Question_Group__c = "A", Answer__c = "Yes", ISPICKVAL(Status__c,"Done Not Reviewed")),
AND(Question_Group__c = "C", Answer__c = "No", ISPICKVAL(Status__c,"Done Not Reviewed")),
AND(Question_Group__c = "B", NOT(ISBLANK(Answer__c)), ISPICKVAL(Status__c,"Done Not Reviewed"))),
"https://c.cs2.content.force.com/servlet/servlet.FileDownload?file=015R00000001kLA", NULL)

 

This was selected as the best answer
janeisaacjaneisaac

Thanks for sticking with it for me Steve! Now I have to add to it. Hopefully, I will be able to handle the rest. If not, I know where to find you ;-)