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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Update: Narrative Insights has been restored and is now available.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
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