I suggest posting the exact options that you specified in the Go To Related Records step. Also, look out for any script triggers that might be tripped for the change in layouts.
Here it is.
It seems like you want it to go to New Window first, then show related record...is that what you want. Then after you go to related record you specify a different layout, then you ask it to go to that layout again. Take out the last "Go to Layout" step. Check with script debugger too.
Also what does it do if the result of the If is false?
I've tried about every combination I can think of, and no matter what I do, it goes to the correct layout - but it shows all the records - instead of just one.
My records are in Form View. So, only the record I want the script to Go To is showing. I am firing the script from that Record, so I don't know why I would need an "Else."
With the last "Go to Layout" disabled, it still shows all the records.
Are you on a layout based on TEAMPLAYER or a layout based on MAIN when you execute this script?
What is the relationship linking the layout's table to Main?
And go to related records can both specify the target layout and open a new window all as part of the same script step, so the new window and go to layout steps are not needed.
I've tried it both ways. From a layout on TEAMPLAYER and from MAIN. What I have just discovered is that it IS "going to the record" - in other words, if I have 4 records and I fire the record from record number 3, when it goes to the layout, it goes to Record # 3. But, then I can still see Records 1, 2 and 4 on the layout. The layout that I am trying to go to is in the MAIN table.
What is the relationship between Team Player and Main? The relatiionship determines the results produced.
And if you want to use GTRR to pull up a found set of records in the Main table, you must use GTRR from a layout based on a related Tutorial: What are Table Occurrences? such that the relationship matches to only the record or records you want to see in the found set when GTRR completes.