How do I ensure a userEvent script fires on save o...
# suitescript
b
How do I ensure a userEvent script fires on save of an INVOICE, even when the CUSTOMER is set to CREDIT HOLD = ON? It looks like no logic fires at all upon save of said INVOICE. In the user interface the popup 'Customer is on credit hold' is displayed and the save of the INVOICE is not allowed. Any workarounds in scripting for this? I just want to write a field value to the INVOICE using userEvent, even if the CUSTOMER is on CREDIT HOLD.
r
have the script call a suitelet that does nothing but set or unset this field. give the suitelet admin permissions, should be able to bypass the issue
i
It seems that you could do a beforeSubmit instead of afterSubmit if you suspect that sometimes the record won't save
b
ahh interesting @Ryan Cook So the Suitelet would have permissions that my userEvent doesn't? I am running the afterSubmit userEvent as ADMINISTRATOR.
r
you might have to go the first route then, which is turn off credit hold, and re-enable it somehow
b
Thanks @iSuite and @Ryan Cook
I think that may be the case unfortunately. Looks like beforeSubmit behaves the same as afterSubmit (doesn't successfully save/submit record). So I'm going to try and turn off/back on CREDIT HOLD!
i
Oh wait duh.. you still have to save the record! Lol. It was too early in the morning and still hadn’t had my coffee. I agree with Ryan 👍
👍 1