3 Replies Latest reply on Nov 10, 2008 9:34 PM by Vaughan

    Closing database warning

    rssterling

      Title

      Closing database warning

      Post

      I have a client that will be attempting to minimize a screen and will inadvertently close the database.  What is the best way to generate a dialogue box stating something like: "Are you sure you want to close the database?" Yes No?

       

      BTW, this is Filemaker 8.5 on PCs.   

        • 1. Re: Closing database warning
          TSGal

          rsterling:

           

          Thank you for your post.

           

          Unfortunately, once you close the file, there is no easy way to stop it.  However, you can create a script that opens a second window before it closes.  Therefore, in a script, you have:

           

          Show Custom Dialog ["Are you sure you want to close this file?"]

          If [Get (LastMessageChoice) = 2]

             Exit Script []

          End If

          New Window []

           

          ============

           

          Assuming you set your default to "No" (button 1) and other option to "Yes" (button 2), if you click "Yes", the script exits and the file closes.  Otherwise, a new window is opened and the old window closes.  You do have a new window and the name will be a bit different (filename 2), but the file with the data remains open.

           

          Please let me know if you need clarification for any of the above steps.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Closing database warning
            jsalzer_1
              

            I've used TSGal's trick before.  It tends to work great for the Mac users.

             

            Unfortunately, since Windows users are likely clicking the "big X", which is equivalent to quitting FileMaker (not just closing the window), they get caught in a loop where once the new window opens, FileMaker tries to close it because it's still trying to quit, which brings back the dialog, and the process continues.

             

            Try it, but I ended up disabling it for Windows users and running it just for the Mac users. 

            • 3. Re: Closing database warning
              Vaughan
                 If you have FMP 8.5 or later and the Developer/Advanced version, you can create custom menus that allow the standard commands to be over-ridden. In this case when the user clicks the close button or choses the Close command from the file menu, it can run your script instead.