E-mail Body - taken from fields - InfoPath Dev
in

InfoPath Dev

E-mail Body - taken from fields

Last post 04-21-2010 09:13 AM by ncolyer. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-20-2010 07:03 AM

    E-mail Body - taken from fields

    I'm using Infopath 2003 and I've created a form.

    I want to have 2-3 submit buttons on the form which send different data off to different people.

    Essentially I want the buttons to take some data from various text box fields on the form and add it to the body of the message. 

    I found this link here: http://www.infopathdev.com/blogs/hilary/archive/2008/08/24/so-you-want-to-send-an-email.aspx but I'm noticing that is for c# and VB.Net. When I open my code screen I get the following:

     function CTRL110_5::OnClick(eventObj)

    {

     

    // Write your code here

     

    }

    Can I use the same code in the link above?

     

     

  • 04-20-2010 11:09 PM In reply to

    Re: E-mail Body - taken from fields

    yes,you can use that

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 04-21-2010 09:05 AM In reply to

    Re: E-mail Body - taken from fields

    It doesn't seem to work. Is this because it's in VB and C#?

    This is what I have now:

     

    function btnSubmit::OnClick(eventObj)

    {

    public void btnSubmit_Clicked(object sender, ClickedEventArgs e)

    { //get the value from the text field

    string interestingText = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:TB-EngineerName", NamespaceManager).Value;

    //get that email submit connection EmailSubmitConnection emailSubmit = (EmailSubmitConnection)this.DataConnections["SubmitForm"];

    //set the introduction with a value from the form

    emailSubmit.Introduction = "This is my shiny new introduction with Engineer Name" + interestingText + "\nAnd an interesting value from a text field as well: The engineer name again! " + interestingText;

    //submit the form

    this.Submit();

     }

    }

     

  • 04-21-2010 09:10 AM In reply to

    Re: E-mail Body - taken from fields

     The code you pasted is for C# in InfoPath 2007+, but your form seems to be set up to use JScript, so this will not work.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-21-2010 09:13 AM In reply to

    Re: E-mail Body - taken from fields

    That's what I thought but the original response I got said I can use that code. I didn't think i was able to.

     

    Is there an easy way to convert it to Javascript or is it easier just to use InfoPath 2007? Does this mean everyone accessing the form will need InfoPath 2007 as well?

    Or how do i get Infopath 2003 to use C# or VB.NET?

    Thanks for your help on this :)

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