October 9, 200520 yr I have an application where I want to do some processing when closing the file, but it appears that when I Quit FileMaker, by the time that the script gets invoked that only one window remains open. All other windows have been closed. Is there any way to prevent this?
October 10, 200520 yr A file's shutdown scripts is run when the *last* window of the file is closed. What processing are you trying to do?
October 10, 200520 yr Author The application was designed with a Shutdown button. I developed a script for that which checked for outstanding (uncommitted) windows by means of some global "status" fields and prompted the user to return to any windows with uncommitted updates. This script worked fine, but if the use quit the application the same script didn't work, so I needed to understand what was happening. I presume (hope) that it doesn't close windows with uncommitted changes. In which case, I just need to check for open windows. Edited additional notes: I hadn't tested this above presumption when I wrote this, but it appears that it closes the windows without commiting the changes. How can I inform the user that there was an open window with unsaved changes? and allow them to return to that window to save them? This is what the script which is invoked by the Shutdown button does. Edited October 10, 200520 yr by Guest
October 10, 200520 yr Author I have developed a workaround ... perhaps not elegant but it appears to work. I added a mandatory field to each database, which if empty generates an error messages asking the user to save the outstanding changes. Then in the various scripts that start an update, I set this field to Null. When the Save Changes process completes, the field is set to non-null. I'd still be interested in a better solution (if such exists.)
Create an account or sign in to comment