3 Replies Latest reply on Mar 4, 2011 1:44 PM by TSGal

    Script Parameters on Timed Triggers

    hschlossberg

      Summary

      Script Parameters on Timed Triggers

      Product

      FileMaker Pro

      Version

      11

      Operating system version

      Windows, Mac

      Description of the issue

      I'm not sure whether this is a bug or "expected" behavior...though it was definitely not expected among a few other developers I asked.

      I am trying to start a timed script trigger using as its script parameter a variable defined earlier in the script.

      I was puzzled and surprised by the fact that the variable in the parameter is not evaluated at the time the timed trigger is defined, but is rather evaluated at the time the triggered script actually runs.

      For this reason, local variables won't work -- you have to use global variables (or else fields are static num/text).  Isn't that strange?

        • 1. Re: Script Parameters on Timed Triggers
          TSGal

          howards:

          Thank you for your post., and I apologize for the late reply.

          For clarification, are you using Pause/Resume Script with a timed duration?  An Install OnTimer Script?  Is this a server-side scheduled script?  Can you provide an example of what you are trying to accomplish and the reason the script is failing?  I just want to make sure I have the right information and can report it properly.

          TSGal
          FileMaker, Inc.

          • 2. Re: Script Parameters on Timed Triggers
            hschlossberg

            Sending you a sample test file, Gal.

            • 3. Re: Script Parameters on Timed Triggers
              TSGal

              howards:

              I received your file.  Thank you.

              Your example includes a Get (ScriptParameter) being passed to a script targeted by an Install OnTimer Script script step.  As you have discovered, this does not work.  When you use an Install OnTimer Script step, the calculation expression is saved and it is evaluated when the script is actually triggered (which could be hours later).  At that time, there won't be a value for Get (ScriptParameter) because we never fire OnTimer during execution of another script.  If you want to save a value for later, then using a global variable is recommended, which again, you have discovered.  The calculation evaluation at time of trigger is the same as all other script triggers.

              TSGal
              FileMaker, Inc.