5 Replies Latest reply on Jun 21, 2012 6:46 AM by philmodjunk

    A page which auto updates

    RobertRichmond

      Title

      A page which auto updates

      Post

      The next request I have had is to create a page where our student homework records are displayed on an LCD display for the students to access. I have built this and it works.

      What I don't know how to do is to get the page to automatically refresh the records whenever a new entry is made or removed?

      Essentially at the moment, the page is static. How might I achieve this goal?

        • 1. Re: A page which auto updates
          philmodjunk

          How did you design this?

          If you change the data/records, in most cases, the update is automatic unless you need to perform a find to pull up a new set of records or you are using looked up value field options when you shouldn't.

          • 2. Re: A page which auto updates
            RobertRichmond

            Thanks for your reply.

            The way it works is like so: A staff member enters in details of a students homework. This data is then moved into the database. The staff then use another screen where they check off the students as they complete their homework.

            What we were wanting to do was to add an LCD display outside that students could view. Whenever a new record was added, it would display the existing records plus this new record. Whenever a teacher marks a student as having completed their homework, I want this dsiplay to also update so the record is removed.

            This works fine for the staff, as they are the ones actioning the data, and the screen changes straight away after they have actioned it. However, the extra screen presently just displays the same data, and never refreshes the display to show what new records are there, or what old records have been removed. Essentially, if I could get it to reload the page every 30 seconds or so, it would do the job just fine. 

            I hope this clarifies what I am trying to achieve. Please let me know if there is any more information I can provide you with.

            • 3. Re: A page which auto updates
              philmodjunk

              The screen will update when a record is deleted, but if the screen is set to show a found set rather than Show All records, it will not update when new records are added from elsewhere on your network.

              You can set up a looping script or a window with Install OnTimer to perform a periodic update that simply reperforms the find that brings up the desired set of found records. This can then include new records in the found set every few records.

              In a loop:

              Loop
                 Perform Find
                 Pause/Resume [10 seconds]
              End Loop

              Note that this is an infinite loop, but a script with the halt step or a button on the screen with the halt option specified can terminate the loop when that is necessary.

              You can also just put the script steps that perform the find in their own script and use Install OnTimer to perform that script every 10 seconds (or any interval in seconds that works for your layout.)

              • 4. Re: A page which auto updates
                RobertRichmond

                Phil,

                Not sure the best way to stop the refresh when I return to the main menu...It keeps going back to the layout that is refreshing? 

                Essentially, it goes to the layout that I want to refresh and runs a script trigger - OnLayoutEnter which runs a script which contains the install OnTimer script. This reloads the layout every 5 seconds. It then sorts the records by date.

                Whenever I exit the layout however, it keeps running this script. I did try to create a Halt option in OnLayoutExit.... bit it still returns to the page every 5 seconds. Any ideas?

                • 5. Re: A page which auto updates
                  philmodjunk

                  The Halt was a way to halt the infinite loop example script with pause in it. It doesn't halt a "timer".

                  To disable a timer, have a script do another Install OnTimer with no parameters specified. I learned this by looking up the script step in Help when I first started using this step.