Error with Recursive Operations

Discussion created by agisllc on Nov 21, 2016
Latest reply on Jun 12, 2017 by agisllc



There's been a longstanding issue with recursive scripts. I apologize for not reporting it earlier, but I believe the problem exists in all of the recent versions (13 or 14+). It is certainly a problem with FileMaker 15.


We've only witnessed the problem on Mac clients where the files are either local or hosted on a Mac server. We have not witness the problem with a PC client or when the files are hosted on a Windows server (even with the Mac client).


The problem is that, with recursive operations, the script continues before "Get (ScriptResult)" is given a value. In other words, it's not waiting for the previous script to finish before continuing. It will happen for both regular and PSoS script calls. The same problem will sometimes happen with parameters that reference local variables.


The problem is not consistent and anything that slows the process down will prevent the problem. It is not possible to replicate it using the debugger, for example. I doubt it's possible to replicate over the WAN either. The problem only occurs when the circumstances yield optimal performance.


The workaround is to insert a 0 second pause (yes, really). The main downside to this solution is that the pause/resume script step brings the window forward (another issue that could be fixed?), so in production environments we have a script that opens a new window off screen, pauses for 0 seconds, and closes the window.


Attached are screenshots of a few examples of recursive scripts where the problem occurred (including 0 second pause steps that solve the problem). I can demonstrate this problem pretty reliably in one of our local development environments (Mac Mini Server with FMS 15.0.3) and it was first brought to our attention by a client of ours running a Mac Server. I doubt it would be easy to create a "sample file" that would yield the problem, however. I'm sure the complexity of the code is a factor.  We've also thoroughly tested the workaround (disable the pause, problem returns; enable the pause, works fine; etc.) and alternative options. Only the pause step seems to fix the problem. 




Michael Bethuy