Hey all - I'm creating a Sales Order with an SS2 U...
# suitescript
t
Hey all - I'm creating a Sales Order with an SS2 User Event script, adding a couple items to the item sublist, and then saving the record. When I attempt to save the record, I get an unexpected error from NetSuite. It seems like all the mandatory fields are set on both the body and the sublist, so I don't believe that's the issue and at this point I'm all out of ideas. I know it's a long shot, but would anyone have any advice at what I should look at with this?
t
can you paste your code?
t
record.selectNewLine({ sublistId: sublist }); _.map(item, function (field) { field = validation.lookForInternalId(record, field); log.audit('field', field) record.setCurrentSublistValue({ sublistId: sublist, fieldId: field.id, value: field.value }) log.audit('sublist val', record.getCurrentSublistValue({ sublistId: sublist, fieldId: field.id })) }) log.audit('commitLine', "#" + index) record.commitLine({ sublistId: sublist }) record.record.save()
Kind of a shoddy copy/paste job that's missing some info 😞
r
record.record.save()
should be
record.save()