A common business requirement for InfoPath forms is to prevent the form from being edited after submission to the form library. While there are several ways to accomplish this task, including editing item level permissions, using audiences or setting a flag via a workflow, many environments can deploy a much easier solution. You can use these steps to implement a simple read only on submit solution.
· To start, create the editable version of the form including the Submit button and a data connection to a location in a SharePoint form library. To do this you need to:
o Open the controls menu and drag a button on to the form.
o Right click on the button and select Properties.
o Click the Submit Options button and check the Allow users to submit this form box.
o Set the drop down box for destination to be SharePoint form library and the Main Submit data connection will be created for the form.
· Next, create a new read-only view. Copy and paste the contents of the original form into this new view. Go to the properties of this view and set the view to be read-only. Optionally, modify this view of the form to display a subset of the fields to create a summary view of the items if desired.
· Create a field in the Main data source called ReadOnly. Set the field as a Boolean with a default value of False.
· Create a rule for the Submit button on the editable view of the form to set the value of the ReadOnly field to True and to submit the form following the steps below.
o Right click the Submit button and select Properties. Click the Submit Options button and change the submit method to be Perform custom action using Rules.
o Select the Rules button and add a Name for the rule. Leave the Condition as default. Add an Action to Set a Field’s value.
o Select the ReadOnly field and for the value select the fx button and click Insert function. Select True and click ok.
o Create a second Action to submit the form using a data connection.
o Select the data connection to the form library where you want to submit the form. Click ok. Click ok on the remaining boxes.
· Next, go to Tools and Form Options from the InfoPath toolbar and select Open and Save Behavior. Click the Rules button in the middle of the screen and set a rule to run on form load.
o Name the Rule and set the Condition as “ReadOnly = True”. Add Action to Switch Views and select the read only view you created above. Click ok.
· (Optional) If you need to make the Read only view editable after submit for specific individuals, you can add a button to the bottom of the read only view called Edit Form. Right click on the button, go to Properties and select Rules and Custom Code on the Action drop down box. Click the Rules button on the bottom of the box and select Add. Enter a name for the rule, leave the Condition as default (always applies) and click Add Action. Select Switch Views and select the editable view of the form from the drop down. Click ok on all of the open boxes. Then set a conditional formatting rule on the button based on the username of the person opening the form using a field set to the function ()username to hide the button.
· Publish the form and test. You should see that when you submit the form to the library and then reopen it, it will open the read only view of the form. Click on the Edit form button on the bottom of the view and the form will refresh and the editable view of the form is now displayed.
· Edit a field on the form and click Submit, the form will be resubmitted to the form library with the changes.



