Hi, I'm trying to write a script to send a customi...
# suitescript
a
Hi, I'm trying to write a script to send a customized email using a template when saving an item fulfillment record. It's a user event script, 2.0, afterSubmit, that loads the item fulfillment via context.newRecord and the merges the template using the N/render module. I'm having trouble pulling the transactionId. I'm wondering if it's null because I'm trying to pull it on afterSubmit? Any advice how I can get the transactionId?
b
actually load the record using record.load
context.newRecord will not reflect anything that is generated after the record is saved like its internal id or document number
a
Sorry, I'm new to SuiteScript so not very familiar to it yet! Wouldn't I need the recordId in order to load the record? How can I pull it?
b
i take back what i said about the internal id
context.newRecord.id should be set
a
Yup, that did it, thank you!