I want to basically populate the Lot Number on the...
# ask-stanley-ai
m
I want to basically populate the Lot Number on the Inventory Detail Subrecord on my item fullfillment. I am using beforeSubmit but Quantity is a mandatory field if we’re trying to set a Lot Number on the subrecord. Is there any way to do this when the record has not been saved and the user is entering the values? I tried using client script but not working
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that you are trying to populate the Lot Number on the Inventory Detail Subrecord on your item fulfillment using a beforeSubmit script. However, you are facing issues because the Quantity is a mandatory field if you're trying to set a Lot Number on the subrecord. From the discussions, it appears that the Inventory Detail Subrecord gets created on submit, which should work, but is required for validation prior to record save and therefore beforeSubmit. One user mentioned that they were able to write to the 'inventoryassignment' sublist using
inventoryDetailSubrecord.setSublistValue()
even though the inventory detail subrecord hasn't been created yet and has an id of null. Another user mentioned a workaround where they created a custom sublist in a before load where they pulled in the list of available serial numbers, had them select the correct ones, then in before submit, they wrote the selected serial numbers into the inventory detail sublist. Another approach mentioned was to create a custom button on the Work Order. The button would load the work order, set the component inventory details, save, then redirect to a new assembly build transformation from that WO. The inventory details get inherited, and the user doesn't need to set it. However, please note that if the field is not editable in the UI, it's unlikely to be editable in script. ****** 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.882626116
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.870045125
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.868945897
Please provide your feedback on this answer.