1 Reply Latest reply on Apr 8, 2014 10:52 AM by philmodjunk

    Loop and Replace Field Contents produce different results



      Loop and Replace Field Contents produce different results


           Hello, I have a database of 25000 records and more than 400 fields. Half of them are calculation, other's indexed fields, in which information from calculation fields is put via replace field contents or loop scripts.

           As replace field contents takes more time to perform on 25000 records, I recently switched to Loop script (which, after some tests, performed faster), where I perform set field scripts, go to next record and exit after last.

           What is bothering me - errors in set field results. For example, if I go to the certain record and compare results of unstored calculation field and indexed field, which result is produced via loop and set field, those results are different.

           How come it be this way? For the calculation fields formulas, I only use indexed fields, i.e. I don't use unstored calculation fields inside my calculation formulas, so I wouldn't believe in explanation that "as the calculation of one field changes, your final result can change". I use "static" data, which is once entered and never re-calculated for my formulas.

        • 1. Re: Loop and Replace Field Contents produce different results

               I am surprised that the looping script was faster. I would have expected the opposite result.

               I can think of several issues to explore:

               The record was not part of the found set when the looping script looped through the records. This might a be due to wrong find criteria or due to a damaged field index producing a different found set than expected.

               Some defect in your script is skipping records--that could be why it is faster.

               If this is a hosted file, both Replace Field Contents and your looping script are vulnerable to edit locks keeping a record from being modified. If you looping script uses set error capture to supress error messages, you might not get any indication that another user had a record open for editing at the moment that you ran this update script.