Hi! Could you advise me on the correct flow here? ...
# suitescript
a
Hi! Could you advise me on the correct flow here? I need to add a custom button on the Job record type via a user event script and send an email passing some data from the current record. Currently, I have created a user event script, added a button, and pointed to a client script where the action of the function is defined. However, when I try to import the 'N/render' module in my client script, the console shows an Uncaught Error: Load timeout for modules: N/render. Then I realized it's not available in the client script. How can I generate an email in this case?
Do I need to just collect all data from client script and call a scheduled script/suitelet?
b
fair chance you can just render the email in the user event
r
If it's just html code in the email. You could create the email body in the client script itself. If you do need to render though then call a suitelet.
a
I thought about rendering the email within user event script, but I dont know ow to detect if a custom button was clicked
b
you can make the button set a field on record that you get in the user event
you can make the user event set a field with the rendered email so you can send the email with the button