3 Replies Latest reply on Apr 9, 2015 3:19 PM by philmodjunk

    Skip script in Loop



      Skip script in Loop


      I have 226 records in a layout. I perform the same script on each record. My script skips some of the records.

      I can't see what they have in common. I can't see why they are skipping.

      I can go to the individual record, and preform the script and it works as expected.

      Any Ideas?


        • 1. Re: Skip script in Loop

          To suggest a possible answer, we'd need to see what that sub script: "What if Invoice..." does.

          • 2. Re: Skip script in Loop

            I get that, i was hoping for a oh ya that happens and here is what to do about it.

            It collects the data on the current layout, goes to another data base, does a find in that data base and brings back that info along with the original. It then does several calulation script steps ( 30 - 100  depending ) and set 2 fields with the results.

            What gets me is if i go to the skipped record, and run the "What if..." script it preforms as expected.From that i "deduced" that it had to be in my loop not the "What if..." 

            If just started doing it, it has worked in the past. I haven't made changes in the layout...

            • 3. Re: Skip script in Loop

              I'd still like to see that script. My guess here is that something in the other script is changing things in a way that results in the skipped record. Anything that changes the current record or the sort order or omits a record would produce the result that you see.

              Either that or the skipped record was open for editing by another user or in a different window on your system and thus an "edit lock" kept the record from being modified. This might be the case if your "set script environment" subscript enables set error capture--a step I don't put in my scripts except in specific cases where I have a script performing a find.

              If you have FileMaker Advanced, enable the debugger and step through your script watching your found set, current record, and sort order to see if you can watch the record get skipped.