This article is relevant if you are developing NetSuite applications against the Sales Order and you need to manipulate the related line based Work Order.
Background
In working with NetSuite light assembly and manufacturing modules, you may need to connect up to a related work order so you can load values and interact. The challenge is that there is no documented way from a Sales Order line item to find the related Work Order internal ID.
Code to Get Work Order ID from Sales Order Line Item
After one of our senior developers spent a few hours on this, through trial and error and speculation, we believe we found a way to connect with the Work Order ID. See the following call:
SO.getLineItemValue(“item”, “woid”, 1)
The key here is “woid” which connects up the Work Order internal ID. Given this is not documented, I recommend being cautious with its use. Let us know if you encounter any updates, hints or changes.
NetSuite Application Developer Opportunities
If you are an independent who appreciates NetSuite’s platform to produce powerful business applications, and you want to work with a team of other professionals that value autonomy, innovation, and ethics, contact us.
Thank you! very helpful for something I needed today.
Mr. Zigman…
I got this error:
“org.mozilla.javascript.EcmaError: TypeError: Cannot find function getLineItemValue in object dynamic record.”
I am using Suite scripts version 2.0
Is there a replacemet for tis API for 2.0?
…Or what do you sugges?
Hello Wellyntong,
Have you tried this?
var lineValue = record.getSublistValue({
sublistId: 'item',
fieldId: 'woid',
line: lineNumber - 1 // Zero-based index in 2.0
});
Marty