Thank you for your post.
Having two separate windows allows you to see two different views of the same table. Window 1 may display record 1 in one layout, and Window 2 may display record 2 in another layout. The two windows are totally independent of one another.
If you are in Window 2 and displaying record 2, when you switch to Window 1 and go to related record, you are going to the related record associated with record 1; not record 2.
In your script, you may want to store a key field to a variable, then when you switch to Window 1, then use the variable in a find to locate that record and then go to the related record. Does that make sense?
Let me know if you need clarification for any of the above steps.
TSGal, thanks for the suggestion on storing a variable to be searched on the second window. That makes good sense, but that was what I didn't want to do (create a field for just that purpose). I thought there might be a simpler selection in the Script Maker window such that I didn't have to search to store a variable to then search it to restore the find and finally delete the variable.
Instead of storing the variable, can I just pass it to the next window and complete the search in one script. Something like:
1) While in Window 2 click button to set variable = to current file field name "myField"
2) SelectWindow 1
3) Find records where field name = variable and list in layout named "ListView"
Note: I always want to have Window 2 only displays records from Table 2 and Window 1 only display records from Table 1. Kinda like floating pallets that have one purpose each. The form I'm creating is a multiuser form and I don't want a field populated with a value that could cause another person to get unexpected search results in the event that two persons do a search at the same time. The variable's value would only exist in the script of a particular users computer for that user's search.
Thanks again ...
It is not easy to achieve what you try to do and it is even harder to control everything in such a setup.
What happens if user closes one of the windows? You always have to check wether the windows are still there.
Worse: what happens if user starts new windows?
And so on ...
I tried this and finally decided not to go this road.
The set up is for a well established way of working here. If the user closes Window 2, he/she knows that they shall click on the provided link to re-open window 2. If the user is closing Window 1, the main user window, that means he is done doing what he/she came to do ...
It may be that I need an "If window exists otherwise create it statement" ...
The users can start new window, if they please but they will always come back to Window 1 and 2 since they would be the most relevant.
We are talking about typical everyday users who don't care too much to poke around and see if they can break anything. They just want to do what they came to do and quit the application.
It may be that I need a script that closes all the windows when the main window is closed ...
This is for a closed focused group. If I were to port it over to the general public, I would have to more seriuosly consider your observations ...
What about my question about passing a variable value ?? Any thoughts ...
Thanks for taking the time to post, much appreciated ...
Uncertified Developer ;)
I recommend closing the second window and reopening with GTRR. This is a two line script and so fairly easy.
Disadvantage is some flickering.