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
Ryan Cook
04/10/2020, 4:12 PM
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
iSuite
04/10/2020, 4:51 PM
It seems that you could do a beforeSubmit instead of afterSubmit if you suspect that sometimes the record won't save
b
bumby999
04/10/2020, 5:22 PM
ahh interesting @Ryan Cook So the Suitelet would have permissions that my userEvent doesn't? I am running the afterSubmit userEvent as ADMINISTRATOR.
r
Ryan Cook
04/10/2020, 5:24 PM
you might have to go the first route then, which is turn off credit hold, and re-enable it somehow
b
bumby999
04/10/2020, 6:09 PM
Thanks @iSuite and @Ryan Cook
bumby999
04/10/2020, 6:10 PM
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
iSuite
04/10/2020, 6:41 PM
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 👍