Cameron
06/16/2026, 6:21 PMCeligo AI
06/16/2026, 6:21 PMAI generated answer (using internal Slack threads):Based on the conversations, the error you're encountering when saving an item receipt created from an outsourced manufacturing PO is likely due to the way you're handling the inventory detail subrecord in your SuiteScript code. The error message
You cannot call getFieldValue method on subrecord field: inventorydetail suggests that you're trying to call the getFieldValue method on a subrecord field, which is not allowed in SuiteScript. Instead, you should be using the getSublistSubrecord method to access the inventory detail subrecord.
Here's a sample code snippet that was shared in the conversations:
javascript
var objRecord = record.load({
type: record.Type.ITEM_RECEIPT,
id: itemrcpt,
isDynamic: false,
});
var objSubRecord = objRecord.getSublistSubrecord({
sublistId: 'item',
fieldId: 'inventorydetail',
line: i
});
var numLines2 = objSubRecord.getLineCount({
sublistId: 'inventoryassignment'
});
for (var j = 0; j < numLines2; j++) {
var serialnumber = objSubRecord.getSublistValue({
sublistId: 'inventoryassignment',
fieldId: 'receiptinventorynumber',
line: j
});
var Subrecordquantity = objSubRecord.getSublistValue({
sublistId: 'inventoryassignment',
fieldId: 'quantity',
line: j
});
dialog.alert({
title: 'Alert',
message: serialnumber
});
}
In this code, the getSublistSubrecord method is used to access the inventory detail subrecord. Then, the getLineCount method is used to get the number of lines in the inventory assignment sublist, and the getSublistValue method is used to get the values of the receiptinventorynumber and quantity fields for each line.
Remember to replace itemrcpt and i with the actual ID of the item receipt and the line number you're working with, respectively.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
06/16/2026, 6:21 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.904602051
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.853149414
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852111876
Celigo AI
06/16/2026, 6:21 PM