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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
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