Before we talk scripts, we need the right relationships.
I will guess that you have these relationships:
Table A ----< Table B
Table A::__pkTableAID = _fkTableAID
There are two different approaches that can get what you request:
Add another table occurrence of Table B to your relationships
Table A -----< Table B | Selected
Table A::_fkSelectedRecord = Table B|Selected::__pkTableBID
A button in your portal could do this:
Set field [Table A_fkSelectedRecord ; Table B::__pkTableBID ]
A container field from Table B|Selected would then show the image from that portal row record.
Or you can define a new container field--either with global storage or just defined as a container field in Table A.
Then your script step would be:
Set Field [Table A::ContainerField ; Table B::Container Field ]
Those are the relationships I have set, yes. I think I like the second option, because table occurrences still confuse me. But how does Table A know which record from ContainerField in Table B to display? Just by selecting that record in the portal?
Yes, the mouse click that clicks the button in the portal row also selects that portal record and makes it the record that that the set field step references for data.
Thank you, that worked!