Re: How can I use the email actionscript to send values of repeating sections?
In case your curious heres my component:TimeOffRequest.zip
In case your curious heres my component:TimeOffRequest.zip
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
function emailPO as c (e as p) 'debug(1) dim poID as n poID = e._currentRowDataNew.ID dim vFilter as c vFilter = "purchase_order.id =" + poID dim filePO as c filePO = "c:\A5Webroot\Reports\PurchaseOrder_"+poID+"_"+date_format(date(),"yyyMMdd")+"_"+time("0h0m")+".pdf" dim vReport as c vReport = report.saveAs("purchase_order@[claretPOS]\claretpos.alb","PDF",vFilter,"",filePO) dim vEmailContact as c vEmailContact = e._currentRowDataNew.VENDOR_CONTACT dim vEmail as c vEmail = e._currentRowDataNew.VENDOR_CONTACT_EMAIL if a5_email_valid(vEmail) = .F. emailPO = "alert('email address for the vendor missing or invalid!');" goto emailError end if delete emailMsg dim emailMsg as p emailMsg.to = vEmail emailMsg.from = "[email protected]" emailMsg.from_alias = "Govindan Gandhi" emailMsg.subject = "Purchase Order" emailMsg.message = <<%emsg% Please see the attached purchase order. Always use current vintage. And would you please send the notes on the items marked as notes needed. If any item is not available please DO NOT BACK ORDER. We will reorder when necessary. Also please let us know when this will be delivered so that we can staff accordingly. Thanks. %emsg% emailMsg.Attachments = filePO result = email_send2(emailMsg) if result = .T. emailPO = "alert( 'The purchase order is emailed to " + vEmailContact +"@ "+ vEmail + "');" else emailPO = "alert('email was not sent');" end if emailError: 'end end function
function emailPO as c (e as p) 'debug(1) dim poID as n poID = e._currentRowDataNew.ID dim vFilter as c vFilter = "purchase_order.id =" + poID dim filePO as c filePO = "c:\A5Webroot\Reports\PurchaseOrder_"+poID+"_"+date_format(date(),"yyyMMdd")+"_"+time("0h0m")+".pdf" dim vReport as c vReport = report.saveAs("purchase_order@[claretPOS]\claretpos.alb","PDF",vFilter,"",filePO) dim vEmailContact as c vEmailContact = e._currentRowDataNew.VENDOR_CONTACT dim vEmail as c vEmail = e._currentRowDataNew.VENDOR_CONTACT_EMAIL if a5_email_valid(vEmail) = .F. emailPO = "alert('email address for the vendor missing or invalid!');" goto emailError end if delete emailMsg dim emailMsg as p emailMsg.to = vEmail emailMsg.from = "[email protected]" emailMsg.from_alias = "Govindan Gandhi" emailMsg.subject = "Purchase Order" emailMsg.message = <<%emsg% Please see the attached purchase order. Always use current vintage. And would you please send the notes on the items marked as notes needed. If any item is not available please DO NOT BACK ORDER. We will reorder when necessary. Also please let us know when this will be delivered so that we can staff accordingly. Thanks. %emsg% emailMsg.Attachments = filePO result = email_send2(emailMsg) if result = .T. emailPO = "alert( 'The purchase order is emailed to " + vEmailContact +"@ "+ vEmail + "');" else emailPO = "alert('email was not sent');" end if emailError: 'end end function
function loadDummyField as c (e as p) Debug(1) dim cn as sql::Connection dim args as sql::Arguments dim sqlSELECT as c dim rs as sql::ResultSet dim dummyField as c '----------------------------------------------- 'Create concatenated days requested '----------------------------------------------- flag = cn.open("::Name::FINANCIAL") args.set("RecID", e.dataSubmitted.PK_TIMEOFF_REQUEST_ID) sqlSELECT = <<%sql% SELECT GROUP_CONCAT(concat_ws(' - ',start_date, hours, payroll_type) ORDER BY start_date [COLOR="#FF0000"]SEPARATOR "\r\n"[/COLOR]) as DummyField FROM timeoff_request_days WHERE fk_timeoff_request_id = :RecID %sql% flag = cn.Execute(sqlSELECT, args) rs = cn.ResultSet dummyField = rs.data(1) cn.FreeResult() cn.close() loadDummyField = "{dialog.object}.setValue('dummyDaysRequested','" +dummyField+ "');" end function
vReport = report.saveAs([COLOR="#FF0000"]"purchase_order@[claretPOS]\claretpos.alb"[/COLOR],"PDF",vFilter,"",filePO)
Comment