Does anyone know of a way to have a transaction go...
# suitescript
p
Does anyone know of a way to have a transaction go back through a SuiteApprovals process when the transaction is edited? We want to have POs be re-approved if anyone modifies it after it's been approved, but if the amount end up being the same the approval isn't triggered.
b
p
We know about the amount tolerance reapproval rules, but also looking for a way to trigger a reapproval if the amount doesn't change
b
make the tolerence 0.0%
p
It won't let you make the tolerance 0, unforutnatey. Tested with both a dollar and %
b
it wont let you in the ui
update it via other means, like suitescript
p
Did that work for you?
b
it makes it annoying to edit in the ui afterwards
but otherwise works fine
p
Hmm, trying to set the Suitelet value runs into the same client-side validation problem
I tried using
record.submitFields()
to update the underlying custom record, and it gives this error:
Copy code
TypeError: Cannot call method \"get\" of undefined
b
what did your code look like
p
In the browser console:
Copy code
const record = require('N/record');
record.submitFields({ type: 'customrecord_sas_approvalrule', id: 4, values: { custrecord_sas_ar_tol_val_amount: 0 }});
I could try through the debugger, or an ad hoc Suitelet or something
b
dont use submitFields
p
I'll give it a try
b
lots of user event scripts dont actually work with xedits
p
Ah, worked when loading/saving. I'll have someone test it out ASAP. Thank you so much!