What do you have on the detail tab? A portal? or something else?
For this example, the detail is not a portal.
I have some other portals that go from a list portal to a detail portal.
I have discovered that this is very complicated, involving setting up a new layout as well as copies of my client table and the contact table and a script using these attached to my add button. I think I have done everything correctly but obviously I am doing something wrong!
The script example you give seems to expect a portal based on a relationship that uses the Client::__kf_clientcontactIDSelected field as one of its match fields--which is why I asked.
I'm not sure of the details here. Are you wanting the current record displayed by your layout to change to the selected record in the portal when this button is clicked?
The portal is on a tab called list
The other tab is called detail and is not a portal, just further details about the contact selected.
When I select a contact on the list tab (in the portal) , I want it to show me the details tab with info about that client. Right now it only shows the first contact.
Where are these details stored?
What tables and relationships are involved?
What table is refered to by your layout?
I think your script needs to use the data from the clicked portal row to perform a find on the layout's table, but could be very wrong here.
I did it!
Your other reply made me look at the table the detail info came from. It should have been from client contact selected.
I can't believe how complex this was! Now I have to try to repeat it for about 6 other tabs.