Seeing as a *Price Quote/Estimate*'s (PQ/E) `trani...
# suitescript
u
Seeing as a *Price Quote/Estimate*'s (PQ/E)
tranid
is only generated after it's created, I'd like to know if there's any way to retrieve that in
afterSubmit
or
beforeSubmit
. For context, I am trying to create a custom implementation of sending an email to a specified address in the Communications subtab of a PQ/E, since the current feature set of Netsuite forces an HTML-type email to be sent when checking the
To Be E-Mailed
option, and we would like to instead send a PDF using the same Advanced template. While I am able to retrieve most of the data I need through a 2.1 UserEvent script, I'm stuck at getting the
tranid
, since this doesn't seem to be generated in either
beforeSubmit
nor
afterSubmit
. I could create a custom field that checks if an email has or hasn't been sent and sends one upon being viewed, but I'd like to reduce custom field dependencies if possible. Any and all inputs appreciated, thanks.
b
do a lookup on the tranid in the after submit
1
u
thanks. running a
record.load
using
context.newRecord.id
seems to work. small overhead, but it works.
b
in general your question is a little weird, you can setup the customer's email preference to be pdf
u
it's not as weird as it sounds; configuring Netsuite to send a PDF uses the legacy templates instead of the Advanced Templates. Trying to change it in the transaction form for the Price Quote doesn't help either. regardless, it works, and that's all I need it to do.