@if must have an odd number of arguments: ')'

I am working with the following formula and getting the error mentioned above. What am I doing wrong.

@If(@IsDocBeingSaved &

YesNo = “Yes” & RegAffected = “Asia” & DateTest_1 = “”;

YesNo = “Yes” & RegAffected = “Brazil” & DateTest_2 = “”;

YesNo = “Yes” & RegAffected = “America’s” & DateTest_3 = “”;

YesNo = “Yes” & RegAffected = “Europe” & DateTest_4 = “”;

@Failure(“This document can not be closed until all testing has been completed for the additional regions selected”);

@Success)

Subject: having another issue now.

Here is what I am trying to do. Based on what regions are affected a box shows up and then they have to Test it before they can close the ticket.

This formula gives me the correct message now message now (not allowing it to be closed ) , but when I go in and edit it and put the dates the error still shows.

At any given time they may only select 1, 2 or 3 additional regions. so I only care about if they selected asia and if the date tested is blank, then I don’t want them to be able to close the ticket, otherwise they can.

Global Impact: Yes/No

Addtional Regions Affected: RegAffected (Asia, Brazil, Europe, America’s)

DateTested_1 shows if they select asia

DateTested_2 shows if they select Brazil

DateTested_3 shows if they select America’s

DateTest_4 shows if they select Europe.

I changed your formula a little just thinking that maybe this would work. But it didn’t :frowning:

@If(@IsDocBeingSaved & (

(YesNo = “Yes” & @IsMember(“Asia” ; RegAffected) & DateTest_1 = “”) |

(YesNo = “Yes” & @IsMember(“Brazil” ; RegAffected) & DateTest_2 = “”) |

(YesNo = “Yes” & @IsMember(“America’s” ; RegAffected) & DateTest_3 = “”) |

(YesNo = “Yes” & @IsMember(“Europe” ; RegAffected) & DateTest_4 = “”)

);

@Failure(“This document can not be closed until all testing has been completed for the additional regions selected”);

@Success)

Subject: a couple of things

Hi again, Lori.

In your post, you’ve mixed up DateTested_1 and DateTest_1. That might just be a typo in your post, but if it’s not, your formula will always fail.

Also, I like to simplify things where possible, so I came up with this:

@If(@IsDocBeingSaved & YesNo = “Yes” & (

(@IsMember(“Asia” ; RegAffected) & DateTest_1 = “”) |

(@IsMember(“Brazil” ; RegAffected) & DateTest_2 = “”) |

(@IsMember(“America’s” ; RegAffected) & DateTest_3 = “”) |

(@IsMember(“Europe” ; RegAffected) & DateTest_4 = “”)

);

@Failure(“This document can not be closed until all testing has been completed for the additional regions selected”);

@Success)

Your formula as it stands will work (if the DateTested vs DateTest issue is resolved), but this version is just a bit “nicer” as it doesn’t check the YesNo value four times.

Phil

Subject: There error was in the ( ’ ) as you said!

Thanks for the headsup on the (') I’ll never use them again!

Subject: putting ; instead of | (I think)

I’m guessing the purpose of your formula, but I think it should be

@If(@IsDocBeingSaved & (

(YesNo = “Yes” & RegAffected = “Asia” & DateTest_1 = “”) |

(YesNo = “Yes” & RegAffected = “Brazil” & DateTest_2 = “”) |

(YesNo = “Yes” & RegAffected = “America’s” & DateTest_3 = “”) |

(YesNo = “Yes” & RegAffected = “Europe” & DateTest_4 = “”)

);

@Failure(“This document can not be closed until all testing has been completed for the additional regions selected”);

@Success)

Hope this helps,

Phil

Subject: apostrophe catastrophe alert!

btw, I feel compelled to get pedantic and mention “America’s”.Firstly, as “Americas” is a plural(not an possessive) noun, you don’t need the apostrophe. Secondly, and probably more importantly, apostrophes can cause havoc in formulas, and programming in general. I prefer to avoid them if possible.

Phil

Subject: Note well taken, I’ll change it

Subject: Most appreciated - IT Worked.

Thank you so much. I’m really in the beginning stages of training, but learning practically by doing!

I’m always getting confused by where the () go! and sugguestion where to look for more detailed info?

Subject: rule of thumb

When I’m reading @If statements (especially massive ones written by someone else), I tend to read them to myself as:

@If( (if this is true) ; (do this) ; (or if this is true) ; (do this) ; (or if this is true) ; (do this) ; (none of them were true so I’m gonna do this) )

It certainly helps to break things down into lines, and indent them too, if you need to make it clearer what’s going on. Notes doesn’t pay any attention to tabs and carriage returns in the middle of formulas, thankfully.

Phil