how to know if emailIt() has worked?
Posted: Mon Aug 22, 2011 2:53 am
I am using an Extra Action Button to email a report directly by calling emailIt(). I need to save a note record to my database when this email has been sent, as a record of what the user has done.
If the user presses 'cancel' in the email dialog box, or if nuBuilder detects an email error I would like to skip creation of the note record.
I have tried the code below:But this code shows the 'nnnnnn' debug even before the user has pressed SEND. Javascript does not wait for emailIt() to complete.
If I understand correctly to only way to make JavaScript do this is for emailIt() to include a callback function? Is that right?
How is it possible to take action if the email was processed correctly? What do you suggest I do here?
If the user presses 'cancel' in the email dialog box, or if nuBuilder detects an email error I would like to skip creation of the note record.
I have tried the code below:
Code: Select all
var scSuccess = emailIt('RPT-ServicePlan', scTo, scFrom, scSubject, scMessage, scFileName, false, 'PDF');
if (scSuccess) {
nuDebug('yyyyyyyyyyyyyyyyyyyyyyyyyyy');
}
else {
nuDebug('nnnnnnnnnnnnnnnnnnnnnnnnnnn');
}
If I understand correctly to only way to make JavaScript do this is for emailIt() to include a callback function? Is that right?
How is it possible to take action if the email was processed correctly? What do you suggest I do here?