Hi i'm transforming the sales order from invoice b...
# suitescript
d
Hi i'm transforming the sales order from invoice but when i tried to save it returns an error saying. "name":"USER_ERROR","message":"Please enter value(s) for: PREPARED BY" Although the invoice was still created. Below is the snippet I used to save the record,
_var_ transformId = objRecord.save({ enableSourcing: true, ignoreMandatoryFields: true });
b
what you are describing sounds like a script or workflow throwing an error after submit
its also why its evil to throw errors after submit. a record is created but you dont know because of the error
d
Tho i have a workaround where in I encapsulate it in try and catch function it works but, I don't think it is the best practices 😞
b
look at workflows and user events deployed on invoices
one of them is probably throwing that error because they expect some fields to be set
set those fields
d
Oks got it. Thank you so much
Thanks for the help.