Hi,
Has anyone had to create a script and add multiple bins with their quantity to a bin put away worksheet? I can't find any resources on how to add the multiple bins with their quantity. I'm currently doing it as a sub record but it's throwing errors. Please see the code below. The part I can't get working is adding the bin and it's quantity.
for (var b = 0; b < itemBins.length; b++) {
log.debug('itemBins', itemBins[b]);
var item_bin_de = itemBins[b].split(":");
log.debug('item_bin_de name', item_bin_de[0]);
log.debug('item_bin_de qty', item_bin_de[1]);
subrecordInvDetail = inventory_adjustment.getCurrentSublistSubrecord({
sublistId: 'item',
fieldId: 'inventorydetail'
});
subrecordInvDetail.selectNewLine({
sublistId: 'inventoryassignment'
});
subrecordInvDetail.setCurrentSublistValue({
sublistId: 'inventoryassignment',
fieldId: 'quantity',
value: item_bin_de[1]
});
subrecordInvDetail.setCurrentSublistValue({
sublistId: 'inventoryassignment',
fieldId: 'binnumber',
value: item_bin_de[0]
});
subrecordInvDetail.commitLine({
sublistId: 'inventoryassignment'
});
}
inventory_adjustment.commitLineItem('item');
}