4 Replies Latest reply on May 19, 2010 10:38 PM by RickWhitelaw

    What happens to a Closing Script if Filemaker crashes?

    Polarpro

      Title

      What happens to a Closing Script if Filemaker crashes?

      Post

      Hey there,

       

      When one of my users closes a Filemaker file or quits Filemaker completely, a Closing Script runs and gathers information that got stored in global variables while the user was working on Filemaker.

       

      I wonder now what happens if Filemaker does not get closed a proper way; for example if a client computer crashes, or (and that happens quite often) if a user sends his machine to sleep before going to lunch. When he starts his computer again he usually sees the Filemaker icon at the bottom bouncing up and down like a Jack Russell terrier and gets a message like "The connection to Filemaker Server got interrupted..."

       

      To me it seems that scripts that run and gather information when closing the file are not a very safe thing. What needs to be considered?

       

      Thanks for your input!

      Mike

        • 1. Re: What happens to a Closing Script if Filemaker crashes?
          philmodjunk

          If the file crashes, the closing script won't have a chance to run.

           

          On the other hand, filemaker regularly and frequently saves data automatically.

           

          If you can avoid using global fields for this data, you'll be much better off as filemaker can save it for you without the need for a closing script.

           

          There are ways to set up a table using the cross product operator "X" instead of "=" that can serve many of the purposes of a global field, but, unlike globals, will save data automatically and which will persist when a client closes the file.

          • 2. Re: What happens to a Closing Script if Filemaker crashes?
            Polarpro

            Hey Phil,

             

            Thank you very much for this... Sounds like a much better idea than the way I've been doing it so far: The pieces of data that need to be stored are being gathered in a global variable separated by carriage returns, and at the end of a session records are being created in the "Report" table, one new record per value.

             

            So, creating a cartesian join should help to store what is necessary right away.

             

            Thanks a lot!  :smileyhappy:  Mike

            • 3. Re: What happens to a Closing Script if Filemaker crashes?
              philmodjunk

              The devil is in the details.

               

              It depends on the structure of your database, what this information represents and how you need to use it.

              • 4. Re: What happens to a Closing Script if Filemaker crashes?
                RickWhitelaw

                Interesting . . . I use a multi-file solution in my business. Each file has a "closer" script . . . some of them are simple cleanup routines. I'm not sure I've ever had a true FM crash! If this happened, the scripts would simply do what they do the next time the files are closed. I believe it's important to NOT allow closing scripts to substantially alter existing data. Cleaning up "empty" records, resetting where you're going to be next time the file is opened . . . fine, but depending on data to be updated would be a scheme completely undone by a crash.

                 

                My 2 cents,

                 

                RW