AnsweredAssumed Answered

Script Inputs Wrong Values, But Not In Debug Mode

Question asked by bratnetwork on Aug 16, 2018
Latest reply on Aug 16, 2018 by bratnetwork

I am having an issue with a script that I am writing, which will grow into a much bigger script, but as I am testing the basics of the first parts it isn't working as it should.  I have scripts very similar to this one that work perfectly and this one is giving me an issue.  The weird part about it is if I use the debugger and go through it step, by step it works perfectly.  Running FMP16A on OSX.

 

The script is for using a barcode scanner to check in received items on a purchase order.  I have a small window that pops up that asks for the UPC code and then the scanner inputs and hits enter and the script runs.  So I have a PO that has 3 items.  If I scan in item #1 its ups the quantity by 2.  If I scan item #2 is ups both items #1 & #2 by 1.  The third item is totally different so the script doesn't try to do anything with it yet.  Tried making a new PO and it does the same thing, also tried this on a windows machine and it acts the same.  I'm confused on how it can come up with the wrong result, but when debugging it comes up with the correct result.

 

script.png

Outcomes