4 Replies Latest reply on May 1, 2009 10:54 AM by TSGal

    OnTimer Script with $Parameter failing

    JohnSindelar_1

      Summary

      OnTimer Script with $Parameter failing

      Description of the issue

      Seems you should be able to use a local $var when installing an OnTimer like this...Set Variable [ $Test; Value:"SOMETHING" ]Install OnTimer Script [ “SecondScript”; Parameter: $Test; Interval: 1 ]...but SecondScript doesn't receive a parameter. Literal strings and $$vars work of course.=(

        • 1. Re: OnTimer Script with $Parameter failing
          TSGal

          JohnSindelar:

           

          Thank you for your post.

           

          I can definitely duplicate the problem.  Unfortunately, I don't know if this is designed this way, so I have forwarded your entire post to our Development and Software Quality Assurance (Testing) departments for comments.  I will post again when I hear more information.

           

          For the mean time, use a global variable.

           

          TSGal

          FileMaker, Inc. 

          • 3. Re: OnTimer Script with $Parameter failing
            TomElliott
              

            I ran into a similar thing yesterday- I was trying to pass on the Script Parameter from a script to on OnTimer script using Get ( ScriptParameter ) as the parameter but the OnTimer script didn't get it. After a while it occurred to me that the OnTimer argument is evaluated when the script runs *not* when it is initially called - this can be confirmed by passing Get ( CurrentTimestamp )

             

            It would be good to know whether this is by intended behavior or a bug - I don't see any mention of this behavior in the documentation.

             

            I can't immediately see any advantage in evaluating at runtime and I think that evaluating at call-time would be more 'expected'

             

            cheers

             

            Tom 

            • 4. Re: OnTimer Script with $Parameter failing
              TSGal

              JohnSindelar:

               

              Here is some updated information from Development...

               

              "The current behavior is consistent with all other script triggers.  When you install an OnTimer script, the calculation expression is saved and evaluated when the OnTimer 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, I suggest using a global variable.  This calculation evaluation at time of trigger is the same as all other script triggers."

               

              This seems to confirm what "TomElliott" posted.

               

              TSGal

              FileMaker, Inc.