Submit a form to both a database and e-mail - InfoPath Dev
in

InfoPath Dev

Submit a form to both a database and e-mail

Last post 04-03-2009 01:06 PM by kminor. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-02-2009 01:49 PM

    Submit a form to both a database and e-mail

    Hello, I'm having trouble figuring out how to do this, and I didn't find an answer when I searched the forum.

    I've got a form that's connected to a database.  I can submit to it fine.  I've got another form that contains code to submit via e-mail.  I put this code in a button's onClick event.

    What I can't figure out is where to put that e-mail code in my database-connected form.  The button is an actual submit button.  It doesn't use rules/codes or anything.  I want the e-mail code to execute BEFORE the database submit because it contains validation scripts for the input data.

     Thanks in advance for any help!

    -- Kelley
  • 04-02-2009 11:10 PM In reply to

    Re: Submit a form to both a database and e-mail

    Hi

    Try validating the fields in OnAfterChange event and the email code on OnClick event of Submit button.

    Madhuri
    http://www.ggktech.com
  • 04-03-2009 07:06 AM In reply to

    Re: Submit a form to both a database and e-mail

    Hi, Madhuri.  Thanks for your response!  I don't think I can perform all of my validation in the onChange events.  Most of my validation involves examining the values of several different fields together -- for example, if the user doesn't provide a customer number, then the customer name, city, and state must be provided.  I couldn't figure out how to put that in the onChange events without making the user enter stuff in a specified order.  And I didn't want to do that.  The code works great if I just run it before the e-mail code (the current version of the form works this way).

    I couldn't figure out how to create an onClick event for the button.  Since it's set to be a submit button, it doesn't show the name of the control anywhere.  Is there a way to find that out?

    -- Kelley
  • 04-03-2009 01:06 PM In reply to

    Re: Submit a form to both a database and e-mail

    Pretty sure I have the code to do this now.  I'll post it for reference after I'm certain it works.

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