Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Discount-type Item Column returns "-100.0%" in client script but "-100" for ever
I'm writing a SuiteScript 2.0 Scheduled Script to copy data from some (but not all) Items in a Sales Order over to a new Custom record type.
The trouble is with the "rate" column on Sales Order : Item sublist.
If I use:
var lineCount = salesOrder.getLineCount({ sublistId: 'item' });
for (var i = 0; i < lineCount; i++){
var itemRate = salesOrder.getSublistValue({ sublistId: 'item', fieldId: 'rate', line: i });
log.debug("itemRate", itemRate);
log.debug("item rate text", salesOrder.getSublistText({ sublistId: 'item', fieldId: 'rate', line: i }));
}
then I get "-100" in the first DEBUG log,
and "-100.00" in the second.
This would be fine if the Item : Rate was set to -100, but it's set to -100.0%
0