We try to track lot number / inventory number of the products shipped on each sales order.
we use a 3Pl it give us the information by an API on Json format. On the 3PL we register the products using the same code we have on Inventory Number for the Assembly product:
the JSON from the 3PL looks like:
var wOrder = {
order: 'xxx000',
carrier: 'fedex',
tracking_number: 'abc123456',
items: [
{
sku: 'AB0135',
quantity: 10,
lot_number: '22143'
}
]
}
This is the code we use to fill inventory detail information during fulfillment:
var inventorydetail = fulfillment.getSublistSubrecord({
sublistId: 'item',
fieldId: 'inventorydetail',
line: i
});
inventorydetail.setSublistValue({
sublistId: 'inventoryassignment',
fieldId: 'binnumber',
value: wOrder.item[0].lot_number,
line: 0
});
inventorydetail.setSublistValue({
sublistId: 'inventoryassignment',
fieldId: 'quantity',
value: wOrder.item[0].quantity,
line: 0
});
inventorydetail.setSublistValue({
sublistId: 'inventoryassignment',
fieldId: 'issueinventorynumber',
value: wOrder.item[0].lot_number,
line: 0
});
after save we receive the error:
'You have entered an Invalid Field Value 22143 for the following field: issueinventorynumber'