I'm writing a script in FM Server 14.
I'm running a loop that creates a PDF on one layout and then goes to another layout and sends an email with the PDF attached.
Because this involves multiple find requests, I've created a search key box, which is checked in all records in the initial found set. As each record is processed, the search key box for that record is unchecked. Then the script loops back and does a search to find the remaining records with the search key checked.
I'm testing this on a set of 9 records. When I start working from the first record, the script loops successfully through 3 records, then stops. When I start with the last record, I can get through 5 of 6 records, before my initial find comes up empty.
I have tried different ways of scripting the find and it doesn't seem to matter. I can't figure out why it works fine then stops working. It doesn't seem to be related to the data in any one record and there's no extraneous characters in my search key mucking that up (and the search key is reset every time I run the script).
at the beginning of the loop:
Go to layout [payments email]
Show All Records
Perform Find [restore]
Go to record/request/page [last]
The rest of the script steps work fine. Where it gets stopped is when the search returns 0 records - but then if I search, I find that there are more records that should have been returned by my find request.
I'm baffled. Would appreciate any input.