Hi all! I've got an odd UserEvent issue, where a p...
# suitescript
g
Hi all! I've got an odd UserEvent issue, where a payment applied as a credit does not save any changes made to context.newRecord during beforeSubmit. Has anyone seen this before and how can I work around it?
Copy code
log.debug({ title: "idString is not empty", details: `Setting custbody_referencetransactions to ${idString}` });
          context.newRecord.setValue({ fieldId: 'custbody_referencetransactions', value: idString });
The log entry goes off just fine with the correct values, but the values don't stick and nothing shows up in the system notes for the payment.
Unapply a payment from its invoice, this will leave a balance that can be applied to other invoices. Pick any invoice for that customer and click the "Accept Payment" button. Instead of processing the payment as usual, scroll down the the credits sublist and select the invoice. Instead of creating a new payment, NetSuite will modify the existing one, and the
context.newRecord
from the create goes away without impacting the edited payment. I guess I'll need to move my code to
afterSubmit
.
ugh, context.newRecordId is blank because its' context is create so afterSubmit doesn't work either. >.<
n
Have you tried doing a get value after you set the field?
That usually helps me to discover what's frequently a typo or stupid gaffe on my part :)
g
No, I ended up moving it to a scheduled map/reduce that runs nightly instead of a UserEvent script