6 Replies Latest reply on Apr 6, 2011 6:55 AM by CarlaS

    Scheduled Exports of Files Inserted in a Container Field

    CarlaS

      Title

      Scheduled Exports of Files Inserted in a Container Field

      Post

      Is there a way to have a script that contains Export Field Contents script step execute on a regularly scheduled basis. 

      What we are trying to accomplish is:  Users insert pdf files into a container field (PDF_Container) and they enter an activation date (PDF_Activation).  The script would execute daily at 6:00pm and export the field contents of the PDF_Container for all records with an activation date tomorrow.

      The Export Field Contents script step cannot be executed as a  server-side scheduled task.  I have considered using the Install OnTimer Script but this seems awkward and I think it would require a client user to always be logged in at 6:00 in order for the script to work.  I don't have much experience with the OnTimer script.

      Does anyone have any suggestions of better ways to handle this export.

      Thanks!

      Carla

      BACKGROUND INFO:

      We are using Filemaker Pro 10 Advanced and Filemaker Server 10 Advanced. Filemaker Server Advanced is running on a Windows PC server. We have about 25 Filemaker client users (both Mac & PC). We also have non-Filemaker client users via Custom Web Publishing.

        • 1. Re: Scheduled Exports of Files Inserted in a Container Field
          philmodjunk

          You can also set up a "robot file" to run scripts on a schedule when the script must run from a client perspective instead of from a server schedule.

          Create a small FileMaker file with a simple script like this:

          Perform Script [//selectscript in hosted file that exports the field contents here]
          Exit Application   //or use close file if you want to leave FileMaker Application up and loaded

          Use File Options to specify that this script run automatically whenever the file is opened.

          Use windows task manager to schedule when this small file will be "run" (Opened).

          If you have passwords that control access to your hosted file like you should, define a matching account name and password in the robot file and use File Options to specify that the file open itself with this account name and password automatically.

          • 2. Re: Scheduled Exports of Files Inserted in a Container Field
            CarlaS

            This all makes sense, but I have a few questions.

            Would this robot file need to be opened on the Filemaker server or one of the client machines?

            I do not have administrator privileges to the server, so I cannot schedule a task to open the robot file.  Is there some other way to accomplish this?

            • 3. Re: Scheduled Exports of Files Inserted in a Container Field
              philmodjunk

              It can be set up on any machine on your network where FileMaker is installed. Installing FileMaker on the Server machine isn't recommended, but you can get away with it (we do) if you take precautions. (We set the task manager to do this late at night when no one else is using the DB and also do not publish anything to the web.)

              • 4. Re: Scheduled Exports of Files Inserted in a Container Field
                CarlaS

                OK.

                Just to clarify, I create the robot file, open the robot file on the FM Server Console.  I assume the robot file should remain open on the console at all times.

                Then use windows task manager  on a machine that has FileMaker client installed to schedule opening the robot file.  I assume that this machine would need to be turned on at all times.  The startup script executes the export script.  The export script should end with closing the file.

                When I use the windows task manager, how do I specify a user account and password for opening the file?

                • 5. Re: Scheduled Exports of Files Inserted in a Container Field
                  philmodjunk

                  No need to open the robot file on the console. You do not need this file anywhere but on the machine where you set up task manager to run the file. The start up script ends by closing the file. The export script does not.

                  Specify account name and password in File Options of the Filemaker file--not the windows task manager. When the file opens, it will automatically open with the specified account name and password, then run the script.

                  You might want to add code in the start up script that prevents the script from running when it has been opened with a full access account. That way, you can open the file by holding down the shift key, enter your admin password and be able to modify the file's script without it first kicking in and exporting the data. (I tend to forget this step as I can use FileMaker advanced with the script debugger to open the file and cancel the start up script instead.)

                  • 6. Re: Scheduled Exports of Files Inserted in a Container Field
                    CarlaS

                    Phil,

                    I have tested everything and it works great.  Thanks for all your good help. 

                    Carla