2 Replies Latest reply on May 24, 2012 5:53 AM by Jade

    Problem With Script using Set Field

    MichaelHemberger1003

      Title

      Problem With Script using Set Field

      Post

      Here's my script and I've run the debugger on it.

      The Set Field command values (variables) have actual values, yet when it gets to the Set Field commands, I can see in the Data View the values don't make it into the actual fields. The fields come up blank, with or without the Commit command.

      Any thoughts on this would be appreciated!

       

      Screen_Shot_2012-05-24_at_12.44.49_AM.png

        • 1. Re: Problem With Script using Set Field
          MichaelHemberger1003

          I found the answer to my own question.

          Basically its my inexperience with the Set Field command.

          The calculation should have been seperated by a ;

          So it should have looked like this:

           

          Set Field [Inspection_Invoice_Totals::ItemAmount;$ThisFieldContents]

          The reason it didn't was I was placing the value portion of set field right in with the specified field. I needed to click the calculation button and enter the $ThisFieldContents in the calculation area.

          Weird thing was Filemaker let me do this without it seeing an error until I ran the debugger and caught the error 5, basically no calculation.

          Hope it can help someone!

          • 2. Re: Problem With Script using Set Field
            Jade

            The Set Field step takes 2 arguments:The Target field and The Calculated result.

            e.g.:

            Set Field [Inspector_Invoice_Totals::ItemAmount ; $ThisFieldContents]

            You appear to have put the variable name in the "Repetition" entry when selecting the target field instead of specifying the calculated result.