How to Close InfoPath Form After Submission When Two Buttons Exist?

I have an browser-enabled InfoPath 2010 form that has two views and a submit button on each view. The form would correctly submit and close the form using one button on the form until the second button was added. After adding the submit button on a second view, the second button submitted/closed but the behavior on the first view changed so that the form no longer closes after submission. I’ve researched this and have not yet found a solution to allow closing the form after submission for one of the buttons.

Things I’ve tried:
 - I’ve attempted creating multiple submit data connections for the different buttons
 - Specifying different Submit Options
 - Try closing the form with the code
 - Add another button to the non-closing view
 - Add duplicate Rule actions to "Close this form: No Prompt"

Settings:
Button rules:
 - Submit using data connection: SharePoint Library Submit
 - Close this form: No Prompt
Button Properties:
 - Action > Rules and Custom Code
The form Submit Options:
 - Send form to a single destination (a form library)
 - Choose a data connection for submit (SharePoint library submit)
 - Advanced > After Submit: Close the form
Advanced form options:
 - Filler Features: all items unchecked (not allowing Save, etc.)
 - E-Mail Attachments: uncheck Enable InfoPath e-mail form functionality for this form template

Resources:
When considering programmatically submitting and closing the form, I understand from this article that the Rules run before code and I can’t close the InfoPath form programmatically by writing code behind a button that has a rule set on it:
http://www.bizsupportonline.net/blog/2009/01/how-to-programmatically-run-code-close-infopath-web-form/

Discussion of creating a custom Save and Submit buttons for InfoPath browser forms:
http://markhaverty.com/sharepoint/custom-save-and-submit-buttons-for-infopath-browser-forms/

  • Edited by RKElder Tuesday, December 13, 2011 5:26 PM spelling correction
December 12th, 2011 11:30pm

Resolution: In the set of Rule Actions that ran before the submission and form close, I had a "Switch Views" action. Removing the "Switch Views" action that preceded the form submission seems to have now allowed the form to close correctly after the submission. So, though the form successfully submitted even with the switching of the view, the final close form action was not working with this present. 
Free Windows Admin Tool Kit Click here and download it now
December 13th, 2011 6:11pm

Delete the button in the closing view and recreate it. Worked for me.
April 19th, 2015 9:57am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics