April 3, 200817 yr I've heard several best practice techniques for optimizing a looping script: 1. Loop through found sets in form view (not list). 2. Loop on a blank layout. 3. Avoid refreshes, try to freeze window. 4. Go to a field first. Any others? Obviously, I'm trying to optimize a report script that's taking 4 mins. It loops thru parents, children and grandchildren so there are several gtrr, setting variables, global fields and creating new records in a report table. Would creating a layout with a portal avoid gtrr and speed up the process (perhaps, because the gtrr is forcing a refresh of some sort?).
April 3, 200817 yr I was going to suggest precisely this Look at Todd Geist's transactional technique, I find it really speeds up these loops, which is another positive side effect ! Edited April 3, 200817 yr by Guest
April 3, 200817 yr Author Thanks. I will look. I believe he wrote about this model in FM Advisor, and I'm sure I have the issue. Thanks. here's a link to Todd's article. Transactions in FileMaker Edited April 3, 200817 yr by Guest
April 13, 200817 yr Author Fabrice, Using portals (with allow create on) to create the child records, rather than grabbing keys in variables and switching layouts/new record took the report from 6 mins to 1 minute! Wow! ...still optimizing.
Create an account or sign in to comment