3 Replies Latest reply on May 10, 2010 9:21 AM by philmodjunk

    Close Window script



      Close Window script


      I have a layout specifically for entering a new record.  That layout does not commit the entered data until the user saves the data with a button (commits the record).  Works fine.


      I have a button on that layout for a new record that takes the user to a help screen (separate layout) for guidance.  It uses a simple script on the button to freeze the screen, open a new window, and go to the help layout.  Works fine.


      HOWEVER, when returning from the help layout back to the original screen/layout I find that the first layout is somehow opened in a new window.  When the user then continues entering data, a flash screen pops up saying that the new data cannot be entered because it is opened in another screen.  When I close that screen, I am then back to where I want to be on the original layout.


      I have tried numerous things on return button script from the help screen:


      - Simply Close Window (which I thought should work)

      - Close Window and go to layout (original)

      - Close Window and go to layout (by name)

      - Close Window, go to layout, and then Close Window again to try and get rid of that second window that opened


      Nothing works.  It keeps going to the duplicate window that is opened and which cannot be modified.


      Any idea of what I'm missing or doing wrong?



        • 1. Re: Close Window script

          I suggest posting a copy of your script(s) involved. From your description, I'm unsure if you have two windows open or three. You can copy and paste a script from a Filemaker advanced Database Design Report or by printing the script as a PDF and copying the text from the PDF file.

          • 2. Re: Close Window script

            The scripts are quite simple.  In playing around with it this morning, I also discovered something that I had not noticed before.


            The new record layout, as I mentioned, is set to not automatically commit entries.  I wanted it that way so the user could fill in the required and optional fields and change them, if needed.  Committing the record is by a button, and that all seems to work fine.  The record cannot be committed until all required fields are entered.


            What I want is that the user can at any time go to the help screen for guidance on how to complete the fields and then return back to the layout keeping all the entries as they were but not yet committed.


            On the new record screen there is a Help button with a simple script:


            New Window []

            Go to Layout ["Help [New Activity Record]" (Admin)]

                                (All Help screens are hosted in a general Admin table, the new record layout is off the Activity table.)


            Clicking the Help button works fine -- the Help screen pops up (full screen).  On the Help screen is a Return button, and that is scripted as:


            Close Window [Current Window]


            Now, what I noticed is that when the Help screen is open, there are only two windows available, the original new record layout and the Help layout.  However, when I close the Help window via the Return button, a NEW window pops up that is identical to the original new record window.  If the user then tries to enter/modify data in the new window, a flash screen pops up that entries cannot be modified as the "record" is already open in another window.  I have looked, and the original new record layout has not created a new record.  Closing the second (duplicate) window lets the user continue as I had wanted.


            I somehow think that the second window is caused by the fact that the record in the original window has not yet been committed, but cannot figure out how or why.


            Any ideas?











            • 3. Re: Close Window script

              Without being able to directly examine and test your file, I can't be sure, but suspect something else in your database is performing a script with a new window script step in it. If you have a copy of filemaker advanced, I'd enable the debugger and test this process--watching for a script to kick in that creates the third window.


              I'm speculating here that you might have a layout based script trigger that is firing off a script that contains a New Window step or a Go To Related Record (with new window option specified) step that is creating your extra window.