1 Reply Latest reply on Aug 26, 2014 8:37 AM by Charlie Bailey

    Exit Application does not execute in a WebDirect session when there is an OnLastWindowClose script...

    Charlie Bailey

      Summary

      Exit Application does not execute in a WebDirect session when there is an OnLastWindowClose script configured.

      Product

      FileMaker Server

      Version

      13.0v4

      Operating system version

      OSX 10.9

      Description of the issue

      The Exit Application script step or button action fails to execute if there is an OnLastWindowClose script step configured.

      Steps to reproduce the problem

      Host a filemaker file with FileMaker Server 13 and configure it for access via WebDirect. Create an empty script (no script steps) and configure this script to run "OnLastWindowClose". Create a single layout and place a button on the layout and configure that button to run the "Exit Application" action.

      Connect to this file via WebDirect and click the button.

      Expected result

      User should be logged out and redirected to the WebDirect "Select A Database" page.

      Actual result

      Nothing happens.

      Exact text of any error message(s) that appear

      Configuration information

      Test file available on request.

      Workaround

      Disable the OnLastWindowClose script trigger or use "Close Window" instead!

        • 1. Re: Exit Application does not execute in a WebDirect session when there is an OnLastWindowClose script...
          Charlie Bailey

               It turns out that Exit Application does indeed have an effect, it's just a little more subtle that I was expecting, and still not the effect that I was hoping for (an application logout). When you instantiate a new window in WebDirect, they "stack" up in the current browser tab. If you're simply executing the New Window script step of button action, you'll see a number appended to your browser tab name that increments each time you execute the New Window action. This behavior seems very similar to the behavior in FileMaker Pro except that you're not getting an actual new window. If you execute a New Window action a 7 times, you'll have a tab with a name like "FileName - 8". If you then issue a Close Window action, the tab number will decrement for each action. When you close the last "Window" you will be logged out of your application.

               It turns out that if you have a file with an OnLastWindowClose script configured, the Exit Application action will close all windows but the last one. So any intended logout action could (should?) be scripted as either:

               
          Exit Application
          Close Window [Current Window]

               -- or --

               
          Loop
          Close Window [Current Window]
          End Loop