InfoPath Tip: Managing older versions | ||
Here is a small tip to manage older versions of InfoPath forms. This is a very simple tip and the solution is available out-of-the-box but unfortunately, InfoPath developers usually ignore this built-in feature and face problems after deploying the updated forms. You may have noticed that you get "Schema validation errors found" when opening an updated form. In fact, the form fails to open and it is difficult to locate the data sources that cause the problem. This question is asked frequently in the forums where users ask for solutions to fix the problem. Some users manually upgrade the XML of existing forms to make them compatible with the new template. In the "Form Options", inside "Versioning" category, there is an option to manage version upgrades. The drop down has three options: > Do nothing (existing forms might not work properly) > Automatically upgrade existing forms > Use custom event By default, the first option "Do nothing ..." is selected. Select the second option "Automatically upgrade existing forms" and save changes. Publish your form. This will automatically upgrade the existing forms and you won't have to update their XML manually which can be quite cumbersome if the library contains hundreds or thousands of forms which is a common scenario in big companies. Some times, it is necessary to keep the existing forms as they are and upgrade them manually if need be but that is rare. User can also take advantage of "Use custom event" option. This will add an event handler to the form where you can add your own custom code but this will be useful only if you know what changes you had made in the form. You can read more about it at http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.formevents.versionupgrade.aspx. For example, you can check the version number of the form being opened and the version number of the template and if the form's version is older than the template's version then you can use custom code to handle the situation. For example, the following will give you the version numbers:
Another option is to add checks in the form using code. Suppose you added a new data source in the form. This data source will not be available in the forms based on the older template. You can check for the existence of the data source/node programmatically and handle business logic accordingly. For example, here is some sample code:
You simplly check the existence of the data source by comparing it to "null". If it's not null (node exists), run new logic for the new form else skip the new logic to keep the old forms intact. |
All About SharePoint is a blog about SharePoint, InfoPath and related technologies. It was started in 2005 and has good readership in many countries. It covers SharePoint 2003, 2007, 2010, 2013, 2016 and Office 365. You can read articles, tips, tutorials and news. It has code samples and complete applications as well.
Saturday, February 21, 2009
InfoPath Tip: Managing older versions
Friday, February 20, 2009
VSTO 2008 extensions for Windows SharePoint Services v3.0, v1.3 - Feb 2009 CTP
Thursday, February 12, 2009
Wednesday, February 4, 2009
New MSDN Article: Integrating External Document Repositories with SharePoint Server 2007
MSDN has published a new article written by a fellow MVP Scot Hillier. This is an excellent article that shows how one can integrate external document repositories like Documentum, etc with SharePoint server 2007. It's not a web part but a complete solution where external repositories can participate in workflows and use task lists and extensible metadata. This is a cutting-edge article.
Tuesday, February 3, 2009
New book: Building content types in SharePoint 2007
Nice post about Podcasting kit for SharePoint
A nice post by Michael Gannotti about Podcasting kit for SharePoint:
kit available on Codeplex:
SharePoint Dispose Checker Tool
SPDisposeCheck is a tool to help users check assemblies that use the SharePoint API. It provides assistance in correctly disposing of certain objects.
MS SharePoint conference 2009
Microsoft SharePoint conference 2009 will be held in October this year in Las Vegas, NV. Technical content related to SharePoint 14 will be presented.
Subscribe to:
Posts (Atom)