You should be able to set the inventory details on...
# suitescript
n
You should be able to set the inventory details on beforeSubmit, here is an example of setting a landed cost beforeSubmit @bumby999
Copy code
const landedCostSublist = curr.getSublistSubrecord({
                sublistId: 'item',
                fieldId: 'landedcost',
                line: lineNumber
            })
            let lineContext = 0
            for (const field in itemObj) {
                    landedCostSublist.setSublistValue({
                        sublistId: 'landedcostdata',
                        fieldId: 'costcategory',
                        line: lineContext,
                        value: categoryObj[field]
                    })
                    landedCostSublist.setSublistValue({
                        sublistId: 'landedcostdata',
                        fieldId: 'amount',
                        line: lineContext,
                        value: itemObj[field]
                    })
                    lineContext += 1
            }