How to resolve errors in InfoPath 2010 formulas
This is a quick tip that shows you how you can use user interface elements in InfoPath Designer 2010 to help you spot and resolve errors in formulas.
Not everyone knows about the tip I’m about to reveal to you. I decided to write and tell you about it, because a couple of days ago, one of my InfoPath 2010 Cookbook readers contacted me via email to ask for help with a formula that was not working.
While I did my best to glance over this very long and complex formula to spot the error to help my reader, I was unable to find the issue. So I recommended using InfoPath itself to help us find the error as follows…
Whenever InfoPath does not like a formula you constructed and you click the Verify Formula button on the Insert Formula dialog box, a warning message box is displayed. There is a Show Details button on this message box you can click to reveal more details about the error(s) in the formula.
While InfoPath error descriptions might sound like gibberish to you, me, or anyone else except for the developer who came up with the error description, there are 6 very useful characters that are always added to error descriptions for InfoPath formulas.
Those 6 characters together form two textual arrows
that point exactly towards the piece of the formula that InfoPath thinks is faulty, as shown in the figure below.
Figure 1. InfoPath 2010 formula error description.
As you can see from the figure above, InfoPath was expecting a comma where mod9 (a name) was found. While I would not agree with InfoPath about the comma, those two arrows would help me find my mistake. Naturally, mod9 should be mod 9 for the formula to function properly.
So, next time InfoPath is giving you a hard time with a formula you constructed, make sure you open the error message details and search for those two arrows. They could save you hours of agony and searching for a needle in a haystack.
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.