Assembly Build Inventory Detail .getSubrecord() re...
# suitescript
a
Assembly Build Inventory Detail .getSubrecord() returning null on beforeSubmit? Unable to set the desired Bin? Any ideas?
c
Just spent the last 2 days looking into this. I have an API that returns a list of available serial numbers, which I needed to enter into the inventory detail on assembly builds. Client Scripts cannot write to the inventory detail sublist, and the inventory detail subrecord gets created on submit, which should work, but is required for validation prior to record save and therefore beforeSubmit. Inventory detail is also read only on before load. You could probably script the whole process, and use suitescript to create the assembly build, but that could get complicated with all the component inventory details if they differ from the WO components sublist. Solution I ended up with was I created a custom sublist in a before load where I pulled in the list of available serial numbers, had them select the correct ones, then in before submit, I wrote the selected serial numbers into the inventory detail sublist. Since the inventory detail subrecord hasn't been created yet, it has an id of null, but you should still be able to write to the 'inventoryassignment' sublist using inventoryDetailSubrecord.setSublistValue(). With my solution, they still have to populate the inventory detail subRecord, but after they save, it writes the correct serial Numbers. Best I could come up with on a limited timescale. I'd be very interested if anyone has a better solution.
s
try dynamic mode or move to afterSubmit()?
a
I was able to solve it beforeSubmit, I was using the wrong methods when handling that in standard mode…
s
NFT 🙂 (I mean, NFT knows the correct methods to call so you don't have to).
👀 1
p
@Carter Reid, I encountered a similar challenge with a client, where they wanted to automatically assign component lots based on FEFO. What we did was 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. Might help in your situation?