2 Replies Latest reply on Jun 21, 2010 9:15 AM by ianmanning

    Open Related record in a new window or an existing new window

    ianmanning

      Title

      Open Related record in a new window or an existing new window

      Post

      Opening is a new window is easy as it's a standard option.

      My problem is that I want the popup window to be smaller that the main window and that means that if someone clicks back in the main window it will hide the popup window. I want to avoid the situation where the window gets hidden so the user clicks the "open related record" button again and a second, third, forth... window opens.

      If the window is hidden and the user clicks  the "open related record" button (which is in a portal) I want the related record to show in the existing window.

      The new Popup window is called "Find Part"

      My script is basically

      if Position ( WindowNames; "Find Part" ; 1 ; 1 ) > 0   This will return true if the "Find Part" window exists  (the position of "find Part" will be greater than 0 if it is in the list of window names)

      select window [Name:"Find Part"]

      Else

      New Window [ Name: "Find Part";......

      End if

      Go to Related Record [From table: "Line Items"; Using layout "Find Part Layout"(Line Items)]

       

      This almost works.

      It will open a new window or switch to the existing window  but it will only show the first record in the "Line Items" Table not the current related record.

      I assume this it looses the connection to the current record in the portal.

      I think I could add a serial number field to the Line Items table and use a variable to find it after switching to the new window

      Any Ideas on how to do this in a simpler or better way? 

      Thanks

      Ian

        • 1. Re: Open Related record in a new window or an existing new window
          philmodjunk

          I make such pop up windows "PsuedoModal" so that they can't be lost behind existing windows and so that the user must close the pop-up before interacting with any of the other windows.

           

          New Window [....

          #Windows platform step to minimize window re-size windows are always kept maximized

          Move/Resize Window [ Name: Get ( Filename ) ; Current File ; Height: Get ( ScreenHeight ) ; Width: Get ( ScreenWidth ) ; Top : 0 ; Left: 0 ]

          #Make new window "Modal"

          Show/Hide Status area [Lock; Hide]

          Allow User Abort [off]

          Loop

             Pause/Resume Script [Indefinitely]

          End Loop

           

          With this approach all user actions that close the window must also use either the Halt Script button setting or a Halt Script script step to terminate the above endlessly paused script.

          I don't see enough info in your post to help you with the rest of your problems as you don't tell us what tables are involved, how they are related, nor how you've set up your Go To Related Record step (There are a lot of options for GTRR steps.) You can even use a GTRR step to both pull up related records and display the results in a new window so you might be able to use it without any new window command. (The above script, modified to use GTRR can still be used to make the pop-up modal.)

           

          Go To Related Records is a very useful tool, but can be hazardous if you don't properly trap for errors. To learn more about GTRR, click the following link:

          The Complete Go To Related Record

           

          • 2. Re: Open Related record in a new window or an existing new window
            ianmanning

            Hi Phil,

            Thanks for the reply.

            The GTRR link was very useful.

            I eventually dropped the GTRR and used a Find by passing the partnumber. This allowed me to do some fancy searching by looping the find, deleting the last character each time a zero found records was returned.

            I then added back an @ and the remaining characters to see if there was a single miss typed character. If this again returned a zero found records I performed a final find on the previously found character string.

            My only problem now is returning the selected partnumber back to the correct portal row. I don't think this will be a big problem.

            Thanks

            Ian

             

            PS I will try your PsuedoModal technique as well.