Find Matching Records Script Step Fails when field is in a portal
Operating system version
Description of the issue
If you right click a field in a portal and select "find matching records", FileMaker finds all parent records with at least one matching portal record. If you set up the field as a button to perform the Find Matching Records script step, FileMaker finds all parent records with at least one portal record that matches the first row in the portal rather than that of the row that was clicked.
Steps to reproduce the problem
for a demo file that shows this issue.
Define two tables and link them in a relationship.
Enter data in the portal's table such that multiple records appear in the portal for multiple parent records.
Set up a field in the portal as a button to do the Find Matching Records script step.
Click the field in any row but the first row and then examine the resulting found set.
For each record in the found set, at least one portal record should show data that matches that of the portal row that was clicked.
For each record in the found set, at least one portal record shows data that matches that of the first portal row on the parent record where the portal field was clicked.
Create a script that sets a variable to the value of the field that is set up as a button and then uses that variable to perform a find. Set up the field to perform this script instead of "find Matching Records".