you should move this ``` subrecord.commitLineItem(...
# suitescript
r
you should move this
Copy code
subrecord.commitLineItem('inventorydetail');
            subrecord.commit();
out also, this should be done when you have finished adding the inventoryassignment lines and want to save the subrecord