SharePoint 2010: How to Maintain InfoPath Form Changes
When InfoPath forms undergo changes, certain requirement mandates that the existing "filled-up" forms (which resides in a form library) should not get affected. How do we achieve this? This article discuss on option(s) available.
Let us look at the question with a use case scenario
- Version used: SharePoint 2010 and InfoPath 2010.
- Design an InfoPath form (browser based) and publish it as Farm administrator approved template.
- Activate this form in a site collection.
- Add the above form as content type in a document library.
- Now, it is available for user to fill up the form and save.
----At this point, user has saved the form----
- There is a change request for InfoPath form, so go ahead and change the design.
- Publish again as before.
- Notice that, user filled form (step 5) is reflecting the changes.
This behavior could pose a problem when user filled forms get into approval channel and are used in an Audit. Any changes to the form which is already approved is sometimes not acceptable to the users.
One solution found to overcome this problem
- Open the form in InfoPath Designer.
- Place a text box control on the default view of the form.
- Call this text box as txtVersion, set the default value to 1, and make it hidden by applying a formatting rule, Next time when there is a change requirement,
- Open the form in InfoPath Designer.
- Create a replica of the default view into another view (call it V2).
- Go to default view, set value of txtVersion to 2.
- Create a rule in form load such that if txtVersion = 2, switch to view V2.
- Publish the form.
Now, all the existing forms keep showing old version and the new forms show modified version.
Note: Yes, this might not be the efficient way of implementing it, but considering other options are not working, this solution would suffice the need. However, this solution becomes more complicated if the InfoPath form itself requires multiple views for users. Also, if the changes are frequent, the above method unnecessarily increase the content of the form. So, this approach should be considered after weighing the requirement and needs and taking into consideration other factors.
If there is an alternate approach to address this problem, do add it in this Wiki article.