Sunday, December 18, 2011

Submitting an InfoPath Form

The problem: The requirements state that the InfoPath form should be submitted in the same location where it is located, and that, upon submission, it should no longer be editable (the submitter should have the read-only access to the form she has submitted.) Furthermore, the submitter should lose the Contribute access to that form and only have Read access.

The solution: 
1) Make a new field in the schema, called Submitted. It should be Yes/No and default to False.
2) Create a new view that is a copy of the original view, minus the Submit button. Make that view read-only and disable view switching on the ribbon.
3) Configure the submit options to be rule-based, so that, upon submission, three things happen:
    a) The Submitted field is assigned the value of True.
    b) The form is submitted to the submit data connection.
    c) The view is switched to the read-only one.
4) Publish the form and make sure that the Submitted field is promoted.
5) Add some event receiver to the form library that is triggered whenever a form residing there is being updated. In the ItemUpdated event, make changes to the updated item whenever its Submitted field changes.

No comments:

Post a Comment