3 Replies Latest reply on May 7, 2013 8:07 AM by philmodjunk

    Control two layouts at once



      Control two layouts at once


           What I am attempting to do is have two separate layouts that are controlled simultaneously. So I would have a layout open in one window and a layout in another window, both with corresponding records. I would like to click on the "next record" or "previous record" in one layout and have it navigate both. Any thoughts?

        • 1. Re: Control two layouts at once

               Use either a custom menu with your own "next record", "previous record" scripts in place of the standard fileMaker options (Requires FileMaker Advanced to set up.) or use the OnRecordLoad script trigger to perform a script that keeps your two windows "synched".

               Be careful of edit locks with your two windows. If you open a record for editing (Click in a field and modify data), you will not be able to edit the same record in the other window until the record in the first window is committed.

          • 2. Re: Control two layouts at once

                 Thank you for your reply, what sort of script would you use OnRecordLoad?

            • 3. Re: Control two layouts at once

                   Set Variable [$RecordNumb ; Get ( RecordNumber ) ]
                   If [ Not IsEmpty ( FilterValues ( WIndowNames ; "NameOfOtherWindow" ) ) // check to see if other window is open ]
                      Select Window [ "NameOfOtherWindow" ]
                      Go to Record/Request/Page [$RecordNumber ; No Dialog ]
                   End If
                   Select Window ["FirstWindowName"]

                   This assumes identical found sets and sort orders in both windows.

                   If you passed the window names as parameters, the same script can be used in both layouts so that interaction with either window "synchs" the other window to match. If you perform finds or sorts on either window, a more sophisticated set up would be needed to keep the other window synched to the same found set and sort order.