skuruvil
04/11/2025, 8:29 PMCeligo AI
04/11/2025, 8:30 PMAI generated answer (using internal Slack threads):If you're encountering the error "You cannot create an inventory detail for this item" when trying to create an Inventory Transfer record via script, it could be due to a few reasons: 1. Item Type: Ensure that the item you're trying to adjust is a serial or lot numbered item. Non-serial/lot/bin items cannot have an inventory detail. 2. Location and Bin Availability: Check if the selected bin is available at the location the item is trying to transfer to. If there is no value in the selected bin, a bin may be required. Here's a sample code snippet that was used in a similar situation:
javascript
rec.selectNewLine('inventory');
rec.setCurrentSublistValue('inventory', 'item', obj.itemId);
rec.setCurrentSublistValue('inventory', 'adjustqtyby', obj.selectedQty);
let invDet = rec.getCurrentSublistSubrecord('inventory', 'inventorydetail');
invDet.selectNewLine('inventoryassignment');
invDet.setCurrentSublistValue('inventoryassignment', 'issueinventorynumber', obj.lotId);
if (obj.selectedBin) {
invDet.setCurrentSublistValue('inventoryassignment', 'tobinnumber', obj.selectedBin.value);
}
invDet.setCurrentSublistValue('inventoryassignment', 'quantity', obj.selectedQty);
invDet.commitLine('inventoryassignment');
rec.commitLine('inventory');
let invTranId = rec.save();
In this code, the script is creating a new line in the 'inventory' sublist, setting the 'item' and 'adjustqtyby' fields, and then creating an 'inventorydetail' subrecord. It then sets the 'issueinventorynumber', 'tobinnumber' (if available), and 'quantity' fields in the 'inventoryassignment' sublist of the 'inventorydetail' subrecord.
******
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
04/11/2025, 8:30 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.847390413
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837839484
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83697629
Celigo AI
04/11/2025, 8:30 PM