4 Replies Latest reply on Jun 4, 2013 11:11 AM by Matty_1

    Timed script



      Timed script


           Every Monday morning we run an inventory check on our data base, at the moment we verbally remind the entire company that they should not be performing any tasks in the data base that could effect the inventory but sometimes they forget.  I'm wondering if there is a way to run a timed script that verifies the time and date and when it's say Monday morning at 3 am a variable is changed that doesn't allow new records to be added until inventory is verified and the variable is changed.

        • 1. Re: Timed script

               If your database is hosted by FileMaker Server, you can schedule a script to be run automatically at a specific time of day. I use FMS 10 and newer versions may allow you to specify the day of the week. If not, the script can use:

               DayOfWeek ( Get ( CurrentDate ) ) = 2

               To detect that today is Monday.

               To lock users out, the script can set a Field to a specific value and then you can use limited access settings in the users' privilege sets to deny edit permission for the tables involved until the script finishes and clears this value from the field. The field can be defined in a table linked to your other tables with the X operator instead of =.

               See "Editing record access privileges" in FileMaker Help and check out this particular sub section: "Entering a formula for limiting access on a record-by-record basis" for a description of how to set this up.

          • 2. Re: Timed script

                 Thank you Phil, I don't have FMS so does that mean there's no way around it?

            • 3. Re: Timed script

                   FMS is the simplest way to set this up, but not the only way. THe other methods depend on using a "robot file" to open your database and perform the script at the specified time.

                   Create a new FileMaker file, no tables or fields needed, just a short script that uses Perform Script to perform the specified script in your original file. Use File Options to automatically open this robot file with a password that has sufficient permission settings to perform that script in your main file.

                   Then use an OS based utility to launch the robot file at the specified time. On windows systems, this can be done with Windows Task manager.

              • 4. Re: Timed script

                     Very good. Thank you Phil!!