2 Replies Latest reply on Aug 23, 2012 9:15 AM by JustinRichardson

    Next Record is going to Last Record

    JustinRichardson

      Title

      Next Record is going to Last Record

      Post

      I have a form set up and I'd like the form to go to the next record after exiting the last field in the form.  I set up a Script Trigger that OnObjectExit a script is run "Go to Record/Request/Page [Next; Exit after last].

      However, after exiting the last field in the form the script sends me to the last record.  I tried chaging the script to Previous and First and Both of those work fine, but Next and Last both send me ot the last record.  Is this a bug or an I doing something wrong?

       

      -Justin

        • 1. Re: Next Record is going to Last Record
          philmodjunk

          It's a matter of understanding how script triggers in general and OnObjectExit in particular work.

          Some triggers "Trip" before the triggering event is executed, some after. OnObjectExit trips before the event. In such triggers, the trigger is tripped, the specified script is performed and then the event that tripped the trigger in the first place takes place.

          Here's what's happening:

          1) A user action starts to exit the field.

          2) The OnObjectExit trigger is tripped and your script takes the focus to the same field of the next record.

          3) The triggering event now proceeds, but since the focus is on a new record, the OnObjectExit trigger is tripped all over again and you are now in an infinite loop that takes you from record to record until there are no more next records to go to.

          The way out of this loop is to know that "before event" triggers allow you to keep the triggering event from actually taking place.

          End your script with: Exit Script [False] and the "exit" will never actually take place and your script will no longer trip its own trigger.

          • 2. Re: Next Record is going to Last Record
            JustinRichardson

            Thank you!  that worked.  Thanks again for helping out a newbie! Smile