Discussions
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Join us
Insert a discount line
I'm trying to insert a discount line on a quotation via SuiteScript, but failing!
I've got it to populate the item, but I want to use a custom price and set the amount.
So far I have this:
currentRecord.insertLine({sublistId: 'item', line: i+1}); currentRecord.setCurrentSublistValue({sublistId: 'item', fieldId: 'item', value: '978'}) currentRecord.setCurrentSublistValue({sublistId: 'item', fieldId: 'price', value: '-1'}) currentRecord.setCurrentSublistValue({sublistId: 'item', fieldId: 'rate', value: '-10%'}) currentRecord.setCurrentSublistValue({sublistId: 'item', fieldId: 'taxcode', value: 'VAT:20%'}) currentRecord.commitLine({sublistId: 'item'})