oriol
11/25/2024, 11:16 AMCeligo AI
11/25/2024, 11:16 AMAI generated answer (using internal Slack threads):In a Work In Progress (WIP) work order, setting the inventory detail for the components when producing using the completion with backflush option can be a bit tricky. When you post completions, you usually have to select the starting and ending operations and then enter the completed quantity. If the ending operation is the last operation in the routing, the quantity to build will copy the completed quantity field. However, when you try to complete with backflush, the quantity field might be disabled. This is because the backflush process automatically consumes the components based on the quantity you are trying to complete. If you want to set the inventory details automatically on Work Order Completion, you can use SuiteScript. Here is a sample code snippet that was shared in one of the threads:
javascript
// work order completion is transforming in dynamic mode
woCompletion.selectLine({ sublistId: 'component', line: 0 });
const componentInventoryDetail = woCompletion.getCurrentSublistSubrecord({ sublistId: 'component', fieldId: 'componentinventorydetail' });
componentInventoryDetail.selectNewLine({ sublistId: 'inventoryassignment' });
componentInventoryDetail.setCurrentSublistValue({ sublistId: 'inventoryassignment', fieldId: 'binnumber', value: bin });
componentInventoryDetail.setCurrentSublistValue({ sublistId: 'inventoryassignment', fieldId: 'quantity', value: quantity });
componentInventoryDetail.commitLine({ sublistId: 'inventoryassignment' });
woCompletion.commitLine({ sublistId: 'component' });
woCompletion.save({
enableSourcing: true,
ignoreMandatoryFields: true
});
This code is trying to set the inventory detail for the first component of the work order completion. It selects the component line, gets the inventory detail subrecord, sets the bin number and quantity, and then commits the line. Finally, it saves the work order completion record.
Please note that this is just a sample code and you might need to adjust it according to your specific requirements.
******
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
11/25/2024, 11:16 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848180532
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839804471
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832877219
Celigo AI
11/25/2024, 11:16 AM