Home Blog Sharepoint Making a Browser Enabled Read Only Form after Submission
Making a Browser Enabled Read Only Form after Submission PDF Print E-mail
Written by Samantha Garofalo   
Thursday, 28 October 2010 11:05

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.


Samantha Garofalo
Written on Thursday, 28 October 2010 11:05 by Samantha Garofalo

Viewed 2556 times so far.
Like this? Tweet it to your followers!

Rate this article

(0 votes)

Latest articles from Samantha Garofalo

Latest 'tweets' from Pinnacle Partners

  • Pinnacle and Microsoft will be hosting an "Unleash Your Productivity" webinar to demonstrate clear and effective commu…http://t.co/AgwZzfmF Link Wednesday, 22 February 2012 04:44
  • Remember the tech hiring event is coming up! Please share with job-seekers and those interested in hiring great... http://t.co/0nqp4yD5 Link Tuesday, 21 February 2012 14:06
  • Check out "AITP ECI Career Fair" http://t.co/3Cyt4fW2 via @eventbrite Link Monday, 20 February 2012 05:20
  • Unleash Your Productivity Webinar - Clear and Effective Communication with Microsoft Lync and Microsoft Office 2010 - https://t.co/R56ZivAL Link Thursday, 16 February 2012 11:41
  • Thanks to Rick Clark, Corp Security Manager, from Ontario Systems for presenting today. Great information on... http://t.co/qErFwV2T Link Tuesday, 14 February 2012 08:23
  • Don't forget today's meeting starting at noon!!! Pita Pit on the menu today and a great presentation!!! Link Tuesday, 14 February 2012 05:43
blog comments powered by Disqus

Last Updated on Wednesday, 03 November 2010 08:42
 
©2010 Pinnacle Web Solutions