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.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Invoice transaction line items not updating aftersubmit
Hello everyone,
I created a SuiteScript that when after submitting a PO, it will go into the Sales Order it was created from and update some transaction line items.
In order to target the Sales Order invoices, I had needed to create a search variable.
const invoiceSearch = search.create({ type: search.Type.INVOICE, filters: [['createdfrom', search.Operator.ANYOF, salesOrderId]],columns: ['internalid']}),
invoiceResults = invoiceSearch.run().getRange({ start: 0, end: 1000 });
Once it created the search, it would look the the invoices and if there an invoice, the ID would generate.
if (invoiceResults.length > 0) {
var invoiceId = invoiceResults[0].getValue({ name: 'internalid' });
}
This works great when it handles one Invoice, but it does not work on multiple.
Tagged:
0