trying to set the customform on an Invoice ... UE ...
# suitescript
d
trying to set the customform on an Invoice ... UE script, afterSubmit, it says it works, but it fails (I have a try catch around it) ... CS script, exact same code, works
would really like to get it working in a UE script, if possible
btw, when I say it fails, I mean the customform hasn't been changed and I get nothing from the try catch around the code
b
share the code
if this is your first attempt at modifying a record in after submit, then you need to either load the record again and save it
or do an xedit via record.submitFields
either option is bad performance wise
d
within the afterSubmit I was doing a currentRecord.get() to find the record ID and then I do a record.load (with N/record) and then I was setting the customform and finishing with a record.save()
as I said above, basically the same bit of code in a CS script, attached to a button and it works
I'd just rather it was something a bit less manual
b
share the code, you shouldnt be able to use N/currentRecord in a serverside script
d
joys of replying at 1am ... UE script I was using context.newRecord.id ... CS script I was using currentRecord.get()
fixed the issue with the UE script anyway, had to use record.submitFields
it seems Netsuite doesn't like you using record.load/record.setValue to change the form, within a UE script ... but it won't throw an error