When you put a button in a portal row, clicking the button does two things:
a) It puts the focus on that portal row.
b) It performs a script
because of a), any calculations in the script or the script's optional script parameter box that refer to fields from the portal's table (occurrence) will refer to fields from the record whose row was clicked.
For more selection portals (both in and not in popovers) you might check out the examples found in:
"Adventures in Filemaking - Enhanced Value Selection"
Unlike the starter solutions, files in this series come with detailed descriptions, comments and other documentation describing how they work and how they were set up while remaining fully working examples of the concept they were set up to demonstrate.
Also post a copy of the script.
In the starter solution, the button with the trigger is a grouped button. What is it grouped with?
Is the button have a script trigger attached and/or does Button Setup perform the script (sometimes both)? If you cant tell by the Button setup, sometimes it's just easier to use the Script Debugger, click the button and see what script is called (which appears like what you did) Many times a button has multiple 'layers'. Could be a blank button, with a text object and a script grouped together. When developing, this is done for many reasons, but usually it's just easier to group so you can copy/paste this button in other places or quickly move the button and keep all the 'layers' in the same orientation. Some people will completely build a button or object from scratch, made up of multiple pieces and once built, want to replicate it many times.
A word about ungrouping. If you highlight and right click and Ungroup (you may have to do this more then once), it may kick a warning message about removing the script. So make sure you know exactly which script, with the script parameters this button is calling.