Submitting form via email - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Submitting form via email

Last post 07-01-2008 11:05 PM by Anuma. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-01-2008 04:33 AM

    • Ntombi
    • Not Ranked
    • Joined on 07-01-2008
    • Posts 3

    Submitting form via email

    i have a form that submits in two ways, firstly the form is send to a section head for him/her to approve/reject the application and then the section head is to click the button to submit the form details to the database.  i decided to use the submit to database button at the end and then programmatic attach code to another button that will send the email to the section head.  below is the code that i am using to send the form as attachment to the section head.  the error i get is that the VarTo is not defined, what should i do

    i fristly tired the email adapter method and then the mail envelope but i get the same error from both methods - PLEASE HELP!!!!

    function SubmitEmail::OnClick(eventObj)

    { // Write your code here- 01/07/2008 (MB)

    //var objEmailAdapter;

    var mail = XDocument.View.Window.MailEnvelope;
    var varTo = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:");
    var varCC = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:CC");
    var varBCC = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:BCC");
    var varIntro = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:Intro");
    var varSubject = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:Subject");


    //objEmailAdapter = XDocument.DataAdapters("EmailSubmitAdapter");

    mail.To = VarTo.text;
    mail.CC = VarCC.text;
    mail.BCC = VarBCC.text;
    mail.Intro = VarIntro.text;
    mail.Subject = VarSubject.text;
    //objEmailAdapter.Submit();
    mail.Visible = true;

    }

  • 07-01-2008 04:50 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Submitting form via email

    Hi,

    Please check the declared variable. you given lower case "v" in the declaration part.

    For ex: You have declared "varTo" and you used "VarTo.text" in the assignment block. Please change for other variables also.

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 07-01-2008 06:39 AM In reply to

    • Ntombi
    • Not Ranked
    • Joined on 07-01-2008
    • Posts 3

    Re: Submitting form via email

    thanks i changed that.

    another error: "Object required"

    please help

  • 07-01-2008 11:05 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Submitting form via email

    Hi,

     You have not given correct xpath for "varto". Can you please change xpath for "varTo". You need to enter field name after "my:" in the below line.

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

    Anuma Chinthapalli /
    http://www.GGKTech.com
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.