My apologies - I didn't test that script before I posted it. I made three mistakes:
- I forgot how the columns were counted - I believe the quantities in your table are in column 4, not column 6
- Everything in the table will be of type string - before the "floor" function will work you need to use parseFloat to convert it to a number
- Row 0 of the table contains the column headings, so you need to process the rows from 1 onwards, not 0 onwards
Also, the line "po_list = new Array();" shouldn't be there. I started with a script designed to do something else as edited it for your scenario, and forgot to delete that line!
Taking all those things into account produces this:
qntcol = 4; // Column number for the quantity field - check this!
rows = args.table[0].length;
args.pass = "Y";
for(i = 1; i < rows; i++) {
qnt = parseFloat(args.table[qntcol][i]);
// The validation goes here
if(Math.floor(qnt) != qnt) {
args.pass = "N";
}
}
I've tested this on a PO, testing for integer prices, and it works for me.
Steve.