Sending email via code (Newbie) - InfoPath Dev
in

InfoPath Dev

Sending email via code (Newbie)

Last post 03-15-2007 09:18 AM by hers2keep. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-14-2007 02:56 PM

    Sending email via code (Newbie)

    I am finishing up my first form for which I've already gotten help today from this forum. Thanks very much for that!

    My next obstacle is to programmatically send via email with the recipient being based upon the values in checkboxes, as well as compared against the signatures already received. The first signature is signing the form, with each subsequent signature signing the previous signature. So all the signatures are on the entire form. Currently, the data is not submitted to a database, but is just following the form itself.

    I need a way to determine who the next recipient for the form should be (they have to sign in order). So, I thought I could have a button created for each signature and have the buttons appear and disappear based upon the checkboxes which determine who all needs to sign it compared to who has already signed it.

    I.e., Immediate Supervisor generates the form & signs it digitally, which then locks all the controls. When they click on "Send Form" it goes to the next person in the list who in turn signs it digitally (still the whole form) and clicks submit and on down the line. So at the end, the form is signed by anywhere from 2-5 people and the last recipient just keeps the form.

    What is the best way to accomplish this? I tried to make a button disappear if a certain signature existed, but I can't figure out how to determine who has signed the form programmatically. When I look at the options under conditional formatting for the button, I can choose signable sections, but they are signing the whole form - not a specific section.

    What's the best way to accomplish my goal?
  • 03-14-2007 03:12 PM In reply to

    Re: Sending email via code (Newbie)

    I would use one or more flag fields (A text or number field created for this purpose) to monitor status. When the form is saved or submitted the flag field increments or changes value. You may want to have one for each signature line and as that person clicks to sign have a rule also mark the flag field. That way you can put complimentary conditional rules in your form to control what is displayed or to alert if the form is out of order.
  • 03-14-2007 03:29 PM In reply to

    Re: Sending email via code (Newbie)

    I'll try that and see how it works!
    Thanks!!

    Carla
    InfoPath Fan (albeit a new one!)
  • 03-15-2007 09:18 AM In reply to

    Re: Sending email via code (Newbie)

    Ok - I set up some checkboxes in the data source, but didn't place them on the form itself. What I'd like to do is perform some logic like this when the user clicks on the "Send Form" button.

    If concat(eFirstNameImmSup," "eLastNameImmSup) is signed;
    Then set ImmSupSigned=True AND email form to HRMgr (set up as a Data Connection);
    Else
    If HRMgrName is signed;
    Then set HRMgrSigned=True AND email form to DeptHead (set up as a Data Connection);
    Else
    If concat(eFirstNameDeptHd," "eLastNameDeptHd) is signed;
    Then set DeptHdSigned=True AND email form to PlantMgr (set up as a Data Connection);
    Else
    If PlantMgrName is signed;
    Then set PlantMgrSigned=True AND email form to ExecMgmt (set up as a Data Connection);
    Else
    If ExecMgmt is signed;
    Then set ExecMgmtSigned=True AND email form to HRMgr (set up as a Data Connection)
    End all the Ifs

    That part I think I can muddle through, but what would be the code to actually send the email to the designated user?
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.