Reputation: 47124
I want a user to be able to do a search in the layout/table "Cages" and then click a button to run a script that will create a new record in a table called "CagesProtocolLineHistory" for each record in the found set.
Below is what I have so far which almost works but on go to original layout line it doesn't go to the next record, it goes to a record near the end. I.e., it's skipping some records.
Upvotes: 0
Views: 12654
Reputation: 4685
You could do this in a three step: search for the "yes"s in a new window; export the record ids (passed params) to a local temp file, and reimport the ids into the child table.
Upvotes: 1
Reputation: 2669
Yes, Go to Record[ first ]
before the loop will ensure that all records are copied. Otherwise, if the script starts at some record other than first, it will skip all records before this.
A couple of notes: FileMaker string comparison is case-insensitive by default, so you don't need to use Upper()
here. Also, in most cases it's simpler not to copy all data through variables, but pass a single key and copy other data via lookups.
Upvotes: 3