I have a web grid with an 'Email' button. When the user presses this button, it opens a UX, populates several fields from the currently selected record, prompts for additional text from the user and allows them to email us this info.
I am having a problem with closing the ux when the email is successfully sent.
The function we have defined to send the email worked fine on Apllication Server builds 2446-4365 and prior, however any builds after this, when the user presses the 'OK' button on the 'email request has been sent' dialog, the calling UX will no longer automatically close and must be done manually.
I assume the problem is with the closeContainerWindow('foo') syntax, but cannot figure out what I am doing wrong.
The function to send the email is as follows:
I am having a problem with closing the ux when the email is successfully sent.
The function we have defined to send the email worked fine on Apllication Server builds 2446-4365 and prior, however any builds after this, when the user presses the 'OK' button on the 'email request has been sent' dialog, the calling UX will no longer automatically close and must be done manually.
I assume the problem is with the closeContainerWindow('foo') syntax, but cannot figure out what I am doing wrong.
The function to send the email is as follows:
Code:
FUNCTION email_sum2 as c (e as p) ' DIM pm as P DIM ps as P DIM ps.timeout as n ps.timeout = 60000 ' IF (email_smtp_open(ps, "mail.mydomain.com", 26, "[email protected]", "PASSWORD")) THEN ' pm.to = "[email protected]" pm.bcc = "[email protected]" pm.from = iif(eval_valid("session.__protected__userid"),session.__protected__userid,"[email protected]") pm.subject = "Web Email Message" msgtxt = "Case No.: "+e._currentRowDataNew.CASE_NO + crlf() msgtxt = msgtxt + "File No.: "+e._currentRowDataNew.FILE_NO + crlf() msgtxt = msgtxt + "Document: "+e._currentRowDataNew.DOCUMENT + crlf(2) msgtxt = msgtxt + "Customer: "+e._currentRowDataNew.CUSTOMER + crlf() msgtxt = msgtxt + "Product: "+e._currentRowDataNew.PRODUCT + crlf() msgtxt = msgtxt + "Address: "+e._currentRowDataNew.ADDRESS + crlf() msgtxt = msgtxt + "City: "+e._currentRowDataNew.CITY + crlf(2) msgtxt = msgtxt + "Customer: "+e._currentRowDataNew.Customer + crlf() msgtxt = msgtxt + "Sent From " + session.__protected__userid + crlf(2) msgtxt = msgtxt + "Notes: " + crlf() +e._currentRowDataNew.NOTE + crlf() pm.message = "Case Notes:"+crlf(2)+msgtxt email_smtp_send(pm, ps) email_smtp_close(ps) email_sum2 = "alert('Email Request has been sent!');{dialog.Object}.closeContainerWindow('foo');" ELSE msgtxt = "Please check your connection." email_sum2 = "alert('Email Request Failed:" + js_escape(crlf(2)+msgtxt) +"');" END IF END FUNCTION
Comment