Discussions
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.