4 Replies Latest reply on Jul 27, 2009 9:03 AM by cntapp

    Problem with Exit Application Button

    cntapp

      Title

      Problem with Exit Application Button

      Post

      Hi all!

       

      I have two buttons on my main screen, one to exit the application and one to log out.

       

      The exit button is simply a "Exit Application" command and does not involve a script. The log out button on the other hand is a script.

      NewWindow [Name: "myfilename"]

      Close Window [Current Window]

      Re-Login []

      I had to do this because with simple Re-Login, if you press cancel you can return to the previous users' access which is not what I want because that doesn't maintain security. But now when the Exit Application button is clicked, it brings up a Re-Login box, and I don't know why.

       

      Any help would be greatly appriciated!

       

        • 1. Re: Problem with Exit Application Button
          TSGal

          cntapp:

           

          Thank you for your post.

           

          I tested out your scripts, and as expected, I could not duplicate the problem.  I know that doesn't help you, so let's try a few things.

           

          My initial thought is the scripts are corrupt.  Therefore, I would create a new script "New Exit" with the sole script command "Exit Application".  Try assigning this script to the "Exit Application" button.  See if this works.

           

          Try creating a new "Re-Log" script with the same commands and attach that to the "Re-login" button.  See if you can make this fail with the other button.  If these now work, then try removing the old buttons and try again.  I don't want any reoccurrence of what was happening previously.

           

          It very well could be the database is damaged.  The best solution is to use a backup.  If one is not available, then use the Recover command (File menu), recover the file, and try again with the recovered file.

           

          Please keep me updated with any progress.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Problem with Exit Application Button
            raybaudi
              

            cntapp wrote:

             

            I don't know why.


            I suspect that the same script ( LogOut ) is attached to the OnClosingFile file option.

             

            BTW: I do not understand the 2 window script steps.

             

            Isn't better:

             

            ScriptName: LogOut

             

            Allow User Abort [ Off ]
            Set Error Capture [ On ]
            Re-Login [ ]
            If [ Get ( LastError ) ]
            Perform Script [ "LogOut" ]
            End If



            • 3. Re: Problem with Exit Application Button
              comment_1
                

              raybaudi wrote:
              I suspect that the same script ( LogOut ) is attached to the OnClosingFile file option.

              That would be my guess, too.

               

               

              Re the script itself: I believe it would be safer to relogin to a "dumb" account (with practically no privileges), before presenting the relogin dialog.


              • 4. Re: Problem with Exit Application Button
                cntapp
                  

                Hello!

                 

                Thank you so much for the responses. They turned out to be very very helpful. The initial problem was that the script was tied to perform the script when closing the application. Not good. But I did end up creating another account that had no privileges to go to when logging in (which is a brilliant idea!) and it works perfectly. From here the database is safe even when the script is somehow interrupted.

                 

                Thank you so much again!