I want to submit a work order completion and enter...
# ask-stanley-ai
b
I want to submit a work order completion and enter an inventory detail for my assembly detail and not components
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that you are trying to set inventory details on a Work Order Completion in NetSuite using SuiteScript. Here is a sample code snippet that might help you:
Copy code
javascript
// Assuming woCompletion is your Work Order Completion record 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: 'issueinventorynumber', value: yourLotNumber }); // Use issueinventorynumber when your inventory decreases
componentInventoryDetail.setCurrentSublistValue({ sublistId: 'inventoryassignment', fieldId: 'quantity', value: yourQuantity });
componentInventoryDetail.commitLine({ sublistId: 'inventoryassignment' });
woCompletion.commitLine({ sublistId: 'component' });
woCompletion.save({
    enableSourcing: true,
    ignoreMandatoryFields: true
});
Please replace
yourLotNumber
and
yourQuantity
with your actual values. This code assumes that you are working in dynamic mode and that you have already created a Work Order Completion record (
woCompletion
). Remember to use
issueinventorynumber
when your inventory decreases and
receiptinventorynumber
when your inventory increases. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844712555
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843384564
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84222281
Please provide your feedback on this answer.
Thank you for your feedback
Thank you for your feedback