FileMaker Function of the Week: EvaluationError
One of the most frustrating situations in FileMaker is when you get a “?” in your calculation instead of the answer to the calculation. Stuart Gripman of FullCityConsulting has a very elegant solution for tracking down the error code lurking behind the “?” using the EvaluationError function:
When FileMaker is faced with this, or any, unsolvable calculation, it returns a question mark for a result.
That question mark just tells you that FileMaker can’t perform the computation. It doesn’t give you any indication as why it’s choking. For a simple example like the one above, figuring it out isn’t such a chore, but FileMaker calculations can get big. If you’ve got a calc that runs 25 lines long and references 8 different fields, tracking down the culprit can be an arduous ordeal. Here is where EvaluationError can help…
First, create a new text field called “expression” in the same table as the problem calculation and place that new field on a layout. Now copy that problematic calc from it’s field or script step of origin and paste it into your expression field.
Next, if you have FileMaker Pro Advanced, open your Data Viewer to the Watch tab and click the + button. Now enter the following formula: EvaluationError ( Evaluate ( myTable::expression ) ). Replace “myTable” with the name of the table where you created the expression field. As soon as you save it, you’ll see the error number causing the question mark.
Gripman also thoughtfully provides a downloadable file with the sample code you can copy directly into your solution. Nice.
More…FileMaker Function of the Week: EvaluationError.