Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
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. Register now
Help creating Sales invoices
I'm trying to create sales invoices on a user event that will eventually be used to prorate subscriptions, but I can't even get the simplest example working.
When running the following code as a user event (beforeLoad, afterSubmit, etc.) The Notice: An error occurred while processing item options. is presented.
var newInvoice = nlapiCreateRecord('invoice');
newInvoice.setFieldValue('entity', 671);
newInvoice.setFieldValue('trandate', '3/11/2007');
newInvoice.setFieldValue('postingperiod', 7);
newInvoice.setLineItemValue('item', 'item', 1, 74);
newInvoice.setLineItemValue('item', 'quantity', 1, '1');
newInvoice.setLineItemValue('item', 'price', 1, '1');
id = nlapiSubmitRecord(newInvoice, true);
I've tried an example for an estimate from the SuiteScriptDevGuide and the same error occurs.