3 Replies Latest reply on Dec 8, 2015 7:26 AM by siplus

    Sort question

    MikeWile

      I have a layout that accesses 10,000 records. A script runs that filters out some records at the beginning. It then sorts the records in preparation for a loop that eliminates certain records. It loops until it is done. Sometimes I notice that in the middle of the looping part of the script it starts sorting again. My question is: Is this because someone has accessed one of the records the script is working on? I get in quite early and this runs fine in the morning. The only time I notice it doing a re-sort is in the middle of the day.

        • 1. Re: Sort question
          jbante

          In your Sort Records script step, do you have the "Keep records in sorted order" option turned on? This can re-sort the records automatically if someone edits data in a field used in the sort, which would explain why you only notice this happening in the middle of the day, presumably when other users are editing data. You might try turning off the "Keep records in sorted order" option to confirm the difference in behavior, and leave it that way if it solves a problem for you.

          • 2. Re: Sort question
            Mike_Mitchell

            MikeWile wrote:

             

            My question is: Is this because someone has accessed one of the records the script is working on?

             

            Possible, but unlikely. The resorting behavior will fire off if you have "Keep records in sorted order" selected when you sort. It does so "at idle". I'm not 100% sure what "at idle" consists of, but I'm reasonably certain it doesn't include while a script is running. If that theory were true, it would mean any looping script could be vulnerable to having its records resorted in the middle. It's more likely something else. What exactly is this script doing?

            • 3. Re: Sort question
              siplus

              the option keep records in sorted order turned on by default is something that goes beyond my ability (and  willingness) of understanding mankind.

               

              Any action requiring extra work by any system we interact with, whose goal is different from saving lives if not turned on (but then it should be already integrated in the system and not be an option), should be turned off by default.