Im doing rec.removeSublistSubrecord server-side to...
# suitescript
m
Im doing rec.removeSublistSubrecord server-side to remove inventory detail but it is not removing the subrecord. Iv tried in dynamic mode and still nada. Any suggestions?
b
share the code
m
var rec = record.load({ type: record.Type.VENDOR_BILL, id: 6534367, isDynamic: true }) rec.selectLine({ sublistId: 'item', line: 0 }) rec.removeCurrentSublistSubrecord({ sublistId: 'item', fieldId: 'inventorydetail' }) rec.commitLine({ sublistId: 'item' }) rec.save()
b
that inventory detail is mandatory
you still need to add a new inventory detail after you remove it
m
Sorry I should've mentioned we are transforming from a PO, in this case it should not be mandatory. Iv created a case with netsuite and they confirmed it is a defect. The workaround is to create with a random bin, save, then load record and remove the sub rec or you can use SS1 and that works as well