AnsweredAssumed Answered

Lists do not pass numeric validation test after GetAsNumber conversion

Question asked by philmodjunk on May 5, 2011
Latest reply on May 10, 2011 by philmodjunk

Summary

Lists do not pass numeric validation test after GetAsNumber conversion

Product

FileMaker Pro

Version

11.03

Operating system version

Windows XP SP3

Description of the issue

With validate always, and Numeric only specified for a field of type number the following script triggers a 502 validation error.

While similar to the report at: http://forums.filemaker.com/posts/daabe4a9cf

This appears to be different issue as this only seems to fail with a list of values. A single number in quotes does not trigger the validation error.

Steps to reproduce the problem

Set Error Capture [on]
Set variable [$Number ; value: list ( 5 ; 4 ; 3 ) ]
Set Field [Table::NumberField ; GetasNumber ( $Number ) ]
Set Variable [$Error ; Value: get ( LastError ) ]
Show Custom Dialog [$Error & ¶ & Quote ( GetAsNumber ( $Number ))]

Expected result

Error = 0
"543"
and 543 appears in numberfield

Actual result

502
"543"

No data is entered in field.

Workaround

As a work around, the following works and also suggests that the FileMaker team needs to look at the returns that separate values in a list to see where the problem lies:

Set variable [$Number ; value: list ( 5 ; 4 ; 3 ) ]
Set Field [Table::NumberField ; getValue ( GetasNumber ( $Number ) ; 1 ) ]

Outcomes