AnsweredAssumed Answered

Parse Error when editing calculation fields with ExecuteSQL

Question asked by DaveBartczak on Jul 24, 2013
Latest reply on Jul 24, 2013 by disabled_ntaylor

Summary

Parse Error when editing calculation fields with ExecuteSQL

Product

FileMaker Pro

Version

12.0v4

Operating system version

Mac OS X 10.8.4

Description of the issue

When editing the calculation of an unstored calculation field which returns any type of data, FileMaker presents a "Parse error." message when these criteria are met :

1. The calculation contains an ExecuteSQL function.
2. Within the first parameter of the ExecuteSQL function, there exists a call to the GetFieldName function.
3. This GetFieldName function has a field from an unrelated table as parameter.
4. Within the first parameter of the ExecuteSQL function, there exists a reference to a parameter defined as "?", Ex. SELECT myField FROM myTable WHERE myField = ?
5. Within the optional 4th parameter of the ExecuteSQL function, there exists one or more references to a native filemaker function.

The problem does NOT occur if the 5th step in the previous list contains values not using any of the FileMaker functions.

Steps to reproduce the problem

Download the Filemaker test file here: https://dl.dropboxusercontent.com/u/85837779/ExecuteSQL_GetFieldName.fmp12

Go in the table containing the single calculation field and uncomment the function reference within the 4th parameter of the ExecuteSQL. Press the OK button to save the changes to the calculation field.

Expected result

Calculation is saved without problem.

Actual result

Popup of error message "Parse Error." and abort of the action to save.

Exact text of any error message(s) that appear

Parse Error.

Workaround

Define the calculated value inside a variable of a "Let" function and reference the variable instead of the function reference.

Screen_Shot_2013-07-24_at_4.20.20_PM.png

Outcomes