AnsweredAssumed Answered

Looped script execution fails only on FMP12 format (but not when stepped through), not on FP7...

Question asked by BobShockey_1 on Apr 2, 2013
Latest reply on Apr 8, 2013 by Fred(CH)


Looped script execution fails only on FMP12 format (but not when stepped through), not on FP7 format.


FileMaker Pro



Operating system version

Windows 7, Mac OS 10.7

Description of the issue

The problem that we're seeing occurs within a Loop/End Loop block of a script. During each iteration of the loop, we first assign a value to a global field. We then commit the record and pull information through a relationship, using the global field as a predicate. We are finding that the first iteration of the loop executes correctly, but the second iteration does not. Instead, the relationship functions as if the global field still contained the value from the first iteration. Thus, we are getting the first set of data twice when we would expect to get a different set of data each time.

In FM 11, the script always works correctly and we don't see this problem. In FM 12, the script works correctly only if we step through it in the debugger, otherwise it fails as described above.

We were able to work around this in FM 12 by adding a "refresh window" step immediately after setting the global field. We were also able to get it to work correctly by adding a "Pause(0.5 sec)" step at the end of each iteration.

It may be important to know that the layout where this script is run is based on the parent table of the table that contains the global field.

This is happening with a large converted solution running on a brand new Dell 64-bit install of Windows Server 2008, SP 2, with 64 GB ram, RAID 5. It is also reproducible on a Mac Mini, 8 GB RAM, 7200 RPM drive.  It's as if the processing is happening too fast for FMP to keep it all straight.

Steps to reproduce the problem

Write a script as designed above. Test in 11, then 12.

Expected result

Different data set each loop iteration.

Actual result

Same data set twice in a row.


Insert "refresh window" or half-second pause in script.