May 10, 200619 yr Newbies I've read most of the old posts and really could use help. I'm performing a Find, then within that set, I'm looping to omit any record where Exported = 'yes'. However, I've run into the problem where Omitting a record automatically goes to the next record! So I end up with half of what i need. I could just take out "Go to Record/Request/Page [ Next, Exit after last ]" but then how do I exit the loop? I tried Exit Loop If [status(CurrentFoundCount) = Status(CurrentRecordCount)] but it zeroes out the records and exits the script. Any help really appreciated, script below: Show All Records Perform Find [ Restore find requests, Replace Found Set ] Sort [ Restore sort order, No dialog ] Go to Record/Request/Page [ First ] Loop If [ Exported = "yes" ] Omit Record End If Go to Record/Request/Page [ Next, Exit after last ] End Loop Export Records
May 10, 200619 yr This should work: Show All Records Perform Find [ Restore find requests, Replace Found Set ] Sort [ Restore sort order, No dialog ] Go to Record/Request/Page [ First ] Loop If [ Exported = "yes" ] Omit Record Else Go to Record/Request/Page [ Next, Exit after last ] End If End Loop Export Records However, you may find it easier to simply add a request to the original Find for a "yes" in the Exported field with the Omit Record option.
May 10, 200619 yr Author Newbies Great, thanks Ender! Omitting the 'Find' is a good suggestion, it just dawned on me I could do a Find requiring that my "Exported" field be blank. Doh!
May 10, 200619 yr It's useful to note: When searching on a unstored calc (in FM5/6), that looping-omit method usually performs better, especially if an initial Find on indexed criteria can first narrow the found set to much smaller number of records for the loop to process.
Create an account or sign in to comment