AnsweredAssumed Answered

Differentiating between Inventory and PO numbers using script

Question asked by EricStover on Jun 21, 2012
Latest reply on Jun 21, 2012 by EricStover


Differentiating between Inventory and PO numbers using script


I am trying to comprehend how to write a script that will determine if a scanned barcode is a inventory number or PO number. Our Inventory numbers are 5 digits (12345) and the PO numbers are 6 digits that start with the fiscal year (125678). I started with 2 IF statements:

If[Length(Scan:Scanned Barcode) = 6]

Perform Script["Scanned PO Number"]

Else If[Length(Scan:Scanned Barcode) = 5]

Perform Script["Scanned Inventory Number"]

End If


The problem I am having is that this script seems to be exiting at the "Else If[Length(Scan:Scanned Barcode) = 5]"  even when a six digit number is scanned. I am not sure if that is a script problem or a script trigger problem.

I am using the onObjectModify to fire the script when a barcode is scanned. The above script is working when I use onObjectKeystroke, but I was having to manually tap the Tab or Return key (it was so much work ;)). I am on Filemaker 10 on a Mac.