Urgent: EmailAdapter Cancel

H

Hasse

Hi,

I have successfully added an emailadapter to my form but I don't know how to
handle the event when a user clicks on Cancel when they are asked to Send or
Cancel the sending of the mail.
Can anyone please help me with this.
I have the code in VB Script but I think I can translate from jscript if
necessary.

Regards,
Hans
 
K

kookie

If you have the code in jscript i would like to see. I am more familar with
jscript even though vb, jscript and c# are close.

If you post the jscript code i will follow up.
 
H

Hasse

Hi,

I'm afraid I don't have the code in jscript but here you have it in vbscript.
Hope this will help.
Sub CTRL31_5_OnClick(eventObj)
Dim Email
Dim Intro
Dim oEmailAdapter
Dim oSaveFormAdapter
Set oEmailAdapter = XDocument.DataAdapters("Send mail")
Set oSaveFormAdapter = XDocument.DataAdapters("Save form")
Email = XDocument.DOM.selectSingleNode("//my:CIOMail").text
oEmailAdapter.To = Email
oEmailAdapter.Subject = "New IS/IT order registered"
Intro = XDocument.DOM.selectSingleNode("//my:MessageCIO").text &
VbCrlf & _
XDocument.DOM.selectSingleNode("//my:FileName").text
oEmailAdapter.Intro = Intro
' Here it crashes if you chose Cancel
oEmailAdapter.Submit()
oSaveFormAdapter.Submit()
XDocument.View.Window.Close(True)
End Sub

Regards,
Hans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top