9 Replies Latest reply on Jan 19, 2014 12:38 PM by DavidJondreau

    New Window

    user28097

      The new window command creates a new window and opens the same layout that is open on the current active window and runs the OnLayoutEnter script for that layout if there is one. I can't see a way to open a new window and specify a different layout to put in that window when it opens, only as the next command after the current layout is already opened. Am I missing something?

       

      It seems like the workaround for this would be to keep a window open (and preferably hidden off-screen) with a really basic layout so that when I want to open a new window, I would first select the window with the basic layout, then create the new window. Is that what others do?

        • 1. Re: New Window
          Mike_Mitchell

          Hello, Kevin.

           

          The customary method for suppressing the script trigger is to use a variable that you set prior to opening the new window. Then, you place your triggered script inside an If / Then block to prevent it from running if the trigger suppression flag is set. Example:

           

          If [ $$noTrigger = 1 ]

            {fire off all your cool stuff}

          End If

           

          In the calling script, you would do something like this:

           

          Set Variable [ $$noTrigger ; 1 ]

          New Window

          Set Variable [ $$noTrigger ; "" ]

           

          There are other methods for doing this as well (such as capturing the name of the window and not firing the triggered code if the name of the window doesn't match the name of the application), but this does work.

           

          HTH

           

          Mike

          • 3. Re: New Window
            user28097

            Thank you. I can see how this would work. In my solution, I have many layouts, any of which might be open when the user selects a menu option that opens another window. Since I already use an "open window" script to open new windows, I'm thinking I may prefer keeping a hidden window open as described in my original post. Is there any reason that would be a bad idea?

            • 4. Re: New Window
              Mike_Mitchell

              Two reasons:

               

              1) If, for any reason, your background window gets closed, your entire scheme falls apart.

              2) There's a considerable amount of window flashing involved.

               

              If you're using a single "open window" script, you should be able to incorporate the trigger suppression variable easily - just put it in that one script, yes?

              • 5. Re: New Window
                user28097

                I would check for it's existance first, and create it again if it were closed. Admittedly, if that happened, I'd be having my original issue. But if I keep it offscreen and don't expose the close window command to the user, I think that should never happen.

                 

                As for adding the trigger suppression variable in my OpenWindow sript, I would also have to add a check to each onLayoutEnter script since any layout could be open when my OpenWIndow script runs.

                 

                I appreciate your feedback and at least understand my options. Mostly, I needed confirmation that I wasn't overlooking an obvious built-in solution for this as it seemed to me there should be a way to open a new window and specify the layout that should be opened with that window.

                • 6. Re: New Window
                  keywords

                  Re your comment: there should be a way to open a new window and specify the layout that should be opened with that window.

                   

                  you can use GTRR as a workaround because that allows you to bundle the new window and selected layout and other options into a single script step.

                  • 7. Re: New Window
                    BruceHerbach

                    My method for doing this is to have a series of blank layouts for each table.  Instead of new window I use GTRR and have it open a new window on the blank layout.  Usually I select the options for Show only relateded record,  Match current record only and usually open it off screen.  So the server should send the minimum amount of data to the new window.    Then I can have the script do anything I want with the new window and no layout or record based script trigger scripts have been run.

                     

                    HTH

                    Bruce

                    • 8. Re: New Window
                      user28097

                      Thank you for pointing out this workaround. Sounds like a better method than keeping a blank window open.

                      • 9. Re: New Window
                        DavidJondreau

                        Also, "hidden" doesn't mean inaccessible. Users can still show a hidden window by using the Window menu item.