e-mail cancel button error - InfoPath Dev
in

InfoPath Dev

e-mail cancel button error

Last post 03-22-2009 06:07 AM by zone2112. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 03-22-2009 06:07 AM

    e-mail cancel button error

    I am using a e-mail data connection to send the form's data and I have a button that calls up SubmitEmail using code.  The e-mail GUI message window shows up, however if the user chooses to press cancel an error appears with the following error message.  My goal is try to prevent this error message. I am new to the whole jscript coding. Any suggestions would be helpful.

    The following error occurred:

    InfoPath cannot submit the form.
    An error occurred while the form was being submitted.
    The form was not submitted because the action was canceled.

    File:script.js
    Line:40

    The code is as follows:

    function SubmitEmail::OnClick(eventObj)

    { // Write your code here var objError; var objEmailAdapter;

    var varTo = XDocument.DOM.selectSingleNode("/my:myFields/my:Emailinfo/mh:To");

     // var varCC = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:CC");

    var varSubject = XDocument.DOM.selectSingleNode("/my:myFields/my:Subject");

    objEmailAdapter = XDocument.DataAdapters("IMemail");

    objEmailAdapter.To = ([email protected]);

    // objEmailAdapter.CC = varCC.text;

    // objEmailAdapter.BCC = varBCC.text;

    objEmailAdapter.Intro = ( "Introtest");

    // objEmailAdapter.AttachmentFileName = "";

    objEmailAdapter.Submit();

    }

     

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.