I need a little help here. I've got a button on Sa...
# suitescript
d
I need a little help here. I've got a button on Sales Orders that sends an order acknowledgment email to our customers. It sends the email, attaches it to the Sales Order then reloads the page. This is done by calling a Suitelet: I use
url.resolveScript
to get the suitelet URL and then
functionName: "window.location.replace('" + suiteletURL + "');"
This works great, however sometimes the user clicks the button and it appears that nothing happens so they click the button again. This results in two emails being sent. Is there any way to prevent the user from clicking the button twice? It'd be nice to have a popup, similar to "You have already submitted this form" or at least have it appear that something is happening.
b
add client script so you can have a more complicated button
s
Change the order things happen, go to suitelet immediately when click, and have the suitelet show some sending or something while the email is being transmitted, then reload the suitelet with confirmation
d
So for client script route: I would basically call a function on the client script to show something to the user, which then calls the suitelet to render the template, then return to the sales order. Correct? The changing of order sounds good. I would prefer to bring then away from the Sales Order then return them after the email is sent.
j
Change the name of the button to 'resend email' if the email has already been sent?
d
The issue is that they pretty much double click the button. The second click is done before the PDF is rendered and emailed. I'll just change the order of events for now. Thanks!