Nour Khaled
01/20/2025, 9:31 AMCeligo AI
01/20/2025, 9:32 AMAI generated answer (using internal Slack threads):To add the inventory detail for an item in your code, you need to create a subrecord for the inventory detail. Here is an example of how you can do it:
javascript
currRec.selectNewLine({ sublistId: 'item' });
currRec.setCurrentSublistValue({ sublistId: 'item', fieldId: 'item', value: itemId });
currRec.setCurrentSublistValue({ sublistId: 'item', fieldId: 'quantity', value: calcPromo });
currRec.setCurrentSublistValue({ sublistId: 'item', fieldId: 'amount', value: 0 });
// Create inventory detail subrecord
var inventoryDetailSubrecord = currRec.getCurrentSublistSubrecord({
sublistId: 'item',
fieldId: 'inventorydetail'
});
// Add lines to the inventory detail subrecord
inventoryDetailSubrecord.selectNewLine({ sublistId: 'inventoryassignment' });
inventoryDetailSubrecord.setCurrentSublistValue({ sublistId: 'inventoryassignment', fieldId: 'binnumber', value: binNumber });
inventoryDetailSubrecord.setCurrentSublistValue({ sublistId: 'inventoryassignment', fieldId: 'quantity', value: quantity });
inventoryDetailSubrecord.commitLine({ sublistId: 'inventoryassignment' });
// Commit the inventory detail subrecord
inventoryDetailSubrecord.commit();
// Commit the line
currRec.commitLine({ sublistId: 'item' });
In this example, binNumber
and quantity
are the values you want to set for the bin number and quantity in the inventory detail. You need to replace them with the actual values or variables that hold these values.
******
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
01/20/2025, 9:32 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.883808255
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.877921402
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.876450956
Celigo AI
01/20/2025, 9:32 AM