2 Replies Latest reply on Apr 29, 2013 3:10 PM by brodlang

    Loop won't dupe



      Loop won't dupe


           Trying to duplicate a found set of records and change some fields via loop script.  I have used this successully in the past, but in this instance only the first found record is acted upon, then the script stops.  I must be zoning out on something simple. Script as follows:



        • 1. Re: Loop won't dupe

               If you were to insert some pause steps or used the script debugger (FileMaker Advanced) to step through this script slowly, you'd find that....

               The newly duplicated record becomes the last record in your found set and thus go to record [next ; exit after last] exits the loop.

               I would use Exit Loop If [ Get (FoundCount ) = 0 ]

               to exit the loop and then would do the following at the end of the loop:

               Omit record
               Go to record/Request/page [first]
               Omit record

               the first omit omits the newly created record from the found set. The next two steps omit the original record from which it was dupilcated.

          • 2. Re: Loop won't dupe

                 Thanks once again Phil.  Works like a charm.  I suspected that I was exiting on the last record but couldn't figure out any way around it.