5 Replies Latest reply on Nov 9, 2011 3:09 PM by philmodjunk

    Script timer to comit records?

    projay

      Title

      Script timer to comit records?

      Post

       How would I set up a script timer to comit records...lets say every 5 minutes?

      -Jay.

        • 1. Re: Script timer to comit records?
          philmodjunk

          Chances are the records would already be committed by then due to some user action such as clicking the layout background, changing records or layouts,etc..

          Install on Timer in one script can set a timer on a 300 second interval. It also would specify a second script that would be performed when the that time interval expires. That second script need only have one script step:

          Commit Record.

          • 2. Re: Script timer to comit records?
            projay

            Muchos Gracias! Phil....Its a clicking away now.....I just installed that timer script on my "presets" so that it runs every time a open this data base.  Is that a good idea?

            Thanks...Jay.

            • 3. Re: Script timer to comit records?
              philmodjunk

              Filemaker commits records automatically, so I don't really see the point to doing a commit record every 5 minutes. It can also change what part of your layout has the focus unexpectedly--which can affect the function of your user interface.

              • 4. Re: Script timer to comit records?
                projay

                Well that makes sense.... I did this so that those on remote computers don't accidentially open a record and leave a field activated.  Any other suggestions in handling this?

                • 5. Re: Script timer to comit records?
                  philmodjunk

                  You might use this for that purpose, but use code that keeps resetting the timer each time the user does something with the database. That turns this into an "on idle for 5 minutes" system.

                  You'd put this line inside numerous scripts in your database that might be performed by the user when editing a record:

                  Install OnTimer Script ["commit Script" ; Interval: 300 ]

                  You can also use:

                  Install OnTimer Script []

                  to disable any timer currently counting down. You might do this when a user clicks a button to go to a main menu screen where they cannot edit any records.

                  Each use of Install OnTimer resets the counter so it will only perform the commit records script if there has been no activity by the user for 5 minutes.

                  You'll need to look over your user interface carefully, using script triggers as needed to also reset the timer and to determine if 5 minutes is a reasonable interval.