Pulling my hair out over this one... I've read all the posts on the message board, tried all recommended approaches and nothing yet. Govindan Gandhi has gottten me the closest... thank you!!
Here's the problem (a very simple one): I just need to send an email with a report attached. That's it. My code is below (tweaked from code provided graciously from GGandh). Two notes: 1)This xbasic code is called from an ajax callback in my button's onclick event (in the grid detail view). 2) I've tried this in V11 and V12 and have the same problem, which leads me to believe that its not a "version" issue.
Finally, here is the error I'm getting:
Error executing Ajax callback function 'SendEmail' Error reported was: command: vReport = report.saveAs("Daily_Activity_Report1@[PathAlias.ADB_Path]\carat.a Function: 'not_valid' was not recognized
THANK YOU!!!!
Here's the problem (a very simple one): I just need to send an email with a report attached. That's it. My code is below (tweaked from code provided graciously from GGandh). Two notes: 1)This xbasic code is called from an ajax callback in my button's onclick event (in the grid detail view). 2) I've tried this in V11 and V12 and have the same problem, which leads me to believe that its not a "version" issue.
Code:
function SendEmail as c (e as p) 'debug(1) dim filePO as c filePO = "c:\A5Webroot"+"_"+date_format(date(),"yyyMMdd")+"_"+time("0h0m")+".pdf" dim vReport as c vReport = report.saveAs("Daily_Activity_Report1@[PathAlias.ADB_Path]\carat.alb","PDF","",filePO) dim vEmail as c vEmail = "[email protected]" if a5_email_valid(vEmail) = .F. emailPO = "alert('email address is missing or invalid!');" goto emailError end if delete emailMsg dim emailMsg as p emailMsg.to = vEmail emailMsg.from = "[email protected]" emailMsg.from_alias = "Scott Binger" emailMsg.subject = "Audit Report" emailMsg.message = <<%emsg% Please see the attached report. Thank you. %emsg% emailMsg.Attachments = filePO result = email_send2(emailMsg) if result = .T. emailPO = "alert( 'The report is emailed." "');" else emailPO = "alert('email was not sent');" end if emailError: 'end end function
Error executing Ajax callback function 'SendEmail' Error reported was: command: vReport = report.saveAs("Daily_Activity_Report1@[PathAlias.ADB_Path]\carat.a Function: 'not_valid' was not recognized
THANK YOU!!!!
Comment