AnsweredAssumed Answered

Peculiar field script triggers when layout is modified

Question asked by Dillik on Sep 8, 2014


Peculiar field script triggers when layout is modified


FileMaker Pro



Operating system version

OS X 10.7.5

Description of the issue

This issue addresses modifying a layout while another window is in a field in that layout in Browse Mode. (This scenario is sometimes thwarted by the misleading message that the layout is being "modified in another window," but this can be avoided by entering the field in the browse-mode window AFTER switching to layout mode in the other window.)

Steps to reproduce the problem

Two windows should be open: window #1 should be in Browse Mode with the cursor in a field, and window #2 should in Layout Mode on the same layout. (You'll also need sample script triggers in place, such as custom dialogs, to let you know what's being triggered when.)

When a change to the layout is saved, certain script triggers are (unexpectedly?) activated depending on the save-state of the field:

• If the field value has been modified (new value is unsaved), the layout update will trigger OnObjectValidate and OnObjectSave in the active field. The cursor will remain in the field, and the record will remain in the "open" state (but the value has been "saved" as it would have if you'd tabbed to another field).

• If the field value has not been modified (the value has already been saved, or the record was never "opened" to begin with), the layout update will instead prompt OnObjectExit in the active field. Oddly, however, the cursor will still remain in the field, and clicking out will trigger a second OnObjectExit for the same field.

For fun, we can chain all this together: first modify the field, then save the layout (OnObjectValidate & OnObjectSave), then save the layout again (OnObjectExit, but no actual exit), then click out of the field (OnObjectExit again, with actual exit).

For all non-field enterable objects, saving the layout trips OnObjectExit without exiting, the same as a field that's been saved.

Expected result

I'm a little surprised a layout change forces an unsaved field value to be "saved" to the uncommitted record (as if you'd tabbed to another field).

More importantly, though, if the user isn't being ejected from an object when the layout updates, there should be no OnObjectExit triggered.