You can select a tab by using the Go To Object script step. Give each tab you want to select this way a unique name in the inspector, then in the script use the Go To Object script step with the name of the tab you want to select. Take care to name the tab itself and not the tabcontrol with all the tabs in it.
This script step can either be in the script where you select the related record but, depending on your needs, you can also put it in a script which loads when a record is being loaded (using a layout-script trigger).
Hi Thanks for your help.
It worked in so far as it took me to the correct tab, but no matter where I click in the portal now it just takes me to the correct tab of the first record that is shown in the portal - previously clicking in the portal led me to a sorted list of the related records. Any idea what is causing that now?
Hi I figured out what I was doing wrong now - thanks for your help