9 Replies Latest reply on May 10, 2011 2:28 PM by philmodjunk

    Validation error when using "Always" validate…



      Validation error when using "Always" validate…


      FileMaker Pro


      11 v3

      Operating system version

      OS X 10.6.7

      Description of the issue

      When a field is set to a Number and the validation is set to "Always", I receive an error 502 when attempting to set the field via a script with a variable using:

      Set variable [$Number ; value: "5" ]
      Set Field [Table::NumberField ; $Number ]

      So I attempted to force the value to be a number with:

      Set variable [$Number ; value: "5" ]
      Set Field [Table::NumberField ; GetAsNumber ( $Number ) ]

      and still received an error # 502 indicating validation issues.

      If I changed the field validation to "Only during data entry" then everything works without any errors.

      Steps to reproduce the problem

      Create a new DB.
      Create a single field (Table::NumberField) with the data type of Number.
      Set validation to "Always"
      Set Strict Data type to "Number"
      Create a new record.
      Run script of:
      Set variable [$Number ; value: "5" ]
      Set Field [Table::NumberField ; GetAsNumber ( $Number ) ]

      Watch the Debugger window and see the error 502 appear on the second step of the script.

      Expected result

      Expected the Function, "GetAsNumber ( )" to actually convert the text "5" in the variable to a number value and allow it to be placed into the field.

      Actual result

      Nothing was entered into the field.
      Debugger showed an error number 502.

      Exact text of any error message(s) that appear

      Number value does not meet validation entry options

      Configuration information



      Turn off validation for "Always" and apply "Only during data entry".