Open Related record in a new window or an existing new window
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"]
New Window [ Name: "Find Part";......
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?