Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
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.