6 Replies Latest reply on Apr 2, 2012 6:46 AM by DavidZakary

    Automatic commit

    DavidZakary

      I've got a bunch of users that leave their desk with records open. When I'm migrating changes to the database, I keeping getting stuck as users have got locked records which prevents me from making the changes.

       

      I'd like to set an OnTimer script that checks every 30 minutes to check for idle users and then automatically commits the record so that I can continue working on the database. Installing the OnTimer script is easy - wondering if anyone has done something similar and come across any issues - validation, resetting timers, etc?

       

       

      Dave Zakary

        • 1. Re: Automatic commit
          jormond

          I use something like it.  I run it every 10 mins.  It's a super low impact script.  The tricky part it that you have to reset that OnTimer script with every change...if you are worried about something getting committed in the middle of another process.  Other than that, it has worked well.

          • 2. Re: Automatic commit
            paulspafford

            Hey Dave,

             

            I did a little write-up about this a while back.

             

            Paul

             

             

             

            --

            Paul Spafford

            FileMaker Database Superhero,

            Spafford Data Solutions

             

            Tel: 613 838 9956

            www.paulspafford.com

            www.ottawafilemakerdeveloper.com

            www.fmlayoutmode.com

            www.fmscripts.com

             

            FileMaker User Group in Ottawa:

            www.meetup.com/fudgeo

            • 3. Re: Automatic commit
              DavidZakary

              Hey Paul - you have a direct link?

               

              I ended up with a couple of script triggers to do it - onTimer, OnLayoutKeystroke and OnRecordLoad.

              • 4. Re: Automatic commit
                paulspafford

                Oops -- forgot to paste!

                 

                <http://fmscripts.com/?p=136>

                 

                 

                 

                --

                Paul Spafford

                FileMaker Database Superhero,

                Spafford Data Solutions

                 

                Tel: 613 838 9956

                www.paulspafford.com

                www.ottawafilemakerdeveloper.com

                www.fmlayoutmode.com

                www.fmscripts.com

                 

                FileMaker User Group in Ottawa:

                www.meetup.com/fudgeo

                • 5. Re: Automatic commit
                  BruceHerbach

                  Paul,

                   

                  Great idea.  Thanks

                   

                  Bruce

                  • 6. Re: Automatic commit
                    DavidZakary

                    What I ended up doing for the auto-commit...

                     

                    • This is mainly needed with a single table
                    • Created an OnRecordLoad script trigger that installs an OnTimer script that runs at an interval
                    • This resets the counter every time a new record is loaded
                      • The script sets a global variable to count repeitions
                      • The OnTimer script checks...
                        • Is the record locked?
                        • If it is locked check the value of the counter variable
                        • If it has reached the timeout value, commit the record, reset counter to 0
                        • If it has not reached the timeout value, add 1 to the total
                    • An additional script trigger is installed - OnLayoutKeystroke
                      • On every keystroke reset the counter to 0

                     

                    So far it works. The only issue that I've run in to is that if a user clicks into a field, but does not hit a key (or modify anything) the record is not locked and the counter does not initiate. Since its not changed it isn't a big issue.