AnsweredAssumed Answered

Alpha characters in $var populate number field as a Zero during script

Question asked by jdevans on Dec 12, 2017
Latest reply on Dec 12, 2017 by philmodjunk

I have a script that operates off of a button click. Once started, if certain conditions are met, a new window opens using a different TO and layout than the one the button was on. That new window is there to create a new record and populate its fields with the values stored in local variables (Single $ vars).
All works as expected except one thing...
One of the vars, $qty_out,  stores either a qty (numeric characters) or a default value of "AR" which stands for "As Required".

Using the debugging tool and Data Viewer, I verified that when the value stored in $qty_out is in fact "AR", then that var is used to populate the field in the newWindow/NewRecord, it shows up as a zero (0).

The step is

    Set Field [TableOccurrence::qty_out ; $qty_out ]


The field is set up as a number field in Manage Database. I've done this sort of thing on other layouts, and scripts, and never remember seeing a number field that wouldn't also hold alpha characters. Maybe I'm mis-remembering this?


Any idea why this is happening???