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