4 Replies Latest reply on Jul 21, 2009 4:27 PM by davidhead

    How to use "Insert Current Date" script in IWP?

    Coupe

      Title

      How to use "Insert Current Date" script in IWP?

      Post

      I create a script which name is "GetCurrentDate".

      The script is shown as below.

       

      Insert Current Date [Update date]

      Commit Records/ Requests[No dialog]

       

      The script is executed when the status field is modified.

       

      It works on the FileMaker client.

      But when I change the status with IWP via browser, the update date field is not updated automatically.

      Who can tell me how to solve?

      Thanks.

       

      BR,

      Coupe

       

        • 1. Re: How to use "Insert Current Date" script in IWP?
          davidhead
            

          From what you have written, I gather that you have used the OnObjectModify script trigger on the Status field. 

           

          What you are missing is that script triggers do not work in a web environment except when triggered by a script action. So in this case, the user modifying a field not trigger the script. This is purely due to the nature of the web environment (it is stateless). 

           

          Anyway, your solution probably lies in an auto-entered calculation in the "Update date" field. This will be: Evaluate ( "Get ( CurrentDate )"; Status ). Make sure it modifies any existing value. It should be triggered when the Status field is modified and the record in IWP is committed.

           

          See how that works for you. 

          • 2. Re: How to use "Insert Current Date" script in IWP?
            Coupe
              

            Thank you for your suggestion.

            I had tried it.

            But the problem is still existed.

            It works on FM Client, but when I update status via web browser, the update date is still the same.

             

            Update date filed = Evaluate ( "Get ( CurrentDate )";Status )

             

            Do you know what I miss?

            Thanks.

             

             

             

            • 3. Re: How to use "Insert Current Date" script in IWP?
              Coupe
                

              When I uncheck the "Do not replace existing value for field (if any)" option, and try again.

              Then it works.

              Thank you very much.

               

              BR,

              Coupe

              • 4. Re: How to use "Insert Current Date" script in IWP?
                davidhead
                  

                Sorry I was unclear. That is what I meant when I said "Make sure it modifies any existing value."

                Glad you got it working.

                Script triggers are the solution for a lot of things but not everything ;-)