You may have to put the portal record's primary key in a variable and, after returning to the layout, use Go to Portal Row in a loop to loop through the records in the portal stopping when the portal record whose primary key matches that in the variable.
It might be poosible to, instead of changing layouts, open a new window and use it to switch to the layout for editing the full portal record. This should leave the focus on the portal record that you clicked to open the editing window, but your portal will also not yet be updated to show the new position in the portal...
Thank you Phil, I guess I will have to do the looping which I was afraid it would slow it down but I guess the portal does not have that many records anyway.
The other solution of a new window is OK but not ideal because the order of the portal lines will change after the editing and I need to show it with the new order.
I tried the first suggestion and it is working fine.
Thank you for your recommendations.
There also might be record locking issues with the two window method.