I have a beforeSubmit script on invoices that chan...
# suitescript
w
I have a beforeSubmit script on invoices that change the customer to the partner on create. The script reaches the end of its execution without any errors but before the next UE-script starts something throws an Unexpected SuiteScript error that does not show up on any script logs. Any ideas? I have a suspicion that the partner in question was created before adding the relation to a new customer...I'm gonna try recreating the partner record from the customer.
Nope, that wasn't it.
If I un-deploy the aforementioned script, no error occur.
s
I would try forceSyncSourcing when setting the new entity, are you doing that?
w
This is an old 1.0 script and it is running perfectly on all other records as far as I can tell. It's too messy to share. 😄 I'll try to debug it...
as soon as I uncomment the line: nlapiSetFieldValue("entity", nNewCustomer, null, true); it throws this error. Still after the execution is complete. Recreating what the script does in the UI doesn't result in an error. Sounds like a NS-support-case. 😕
s
its because its not firing fieldChange, maybe?
tell it to
w
tried it, didn't help.
When I remove one specific order-line, I can save the invoice. Weird how that is somehow connected to changing the customer on the invoice.
Ok, so that one line has the standard price level. It's the only one on the order. If I, prior to saving the new invoice, change that to "custom" price level with the same rate, it saves alright.