How to convert an InfoPath 2003 form template to InfoPath 2010

Learn what steps to take if you want to convert an InfoPath 2003 form template into an InfoPath 2010 form template or for use as an InfoPath browser form in SharePoint.

ADVERTISEMENTS

When InfoPath 2003 was released, it came with a bunch of sample form templates you could select and modify as you pleased.

Unfortunately, many of these templates were not upgraded to be included in InfoPath 2007, and then they were completely gone in InfoPath 2010.

However, you can still find a few of these form templates for download on Office Online, or if you still have a copy of InfoPath 2003 installed somewhere, you can copy the form templates from the directory where InfoPath is installed.

While these InfoPath form templates were good starter templates, often times they contained JScript code. And what I have found is that a lot of the functionality for which code was written was not really necessary in the end.

As an example, I tried converting the InfoPath 2003 Meeting Agenda and Purchase Order form templates to InfoPath 2010. This is how I did it…

First I saved the InfoPath 2003 form templates as extracted form files, so that I could get to the script.js file to see which actions were being performed with code. When you open the manifest.xsf in InfoPath 2010, you get a message saying:

This form template is not compatible with the current version of InfoPath.

To fix this problem, you must upgrade this template. To edit the form, all users will need to have InfoPath 2003 SP1 or later installed.

Do you want to upgrade this form template?

After you click OK on this message box, you are not done with the conversion process yet. If you look at the Page Design tab in InfoPath 2010, you will see that the predefined page layouts and themes for InfoPath 2010 are missing. The reason some InfoPath 2010 features are missing is because the form template is still an InfoPath 2003 form template.

So to really convert the InfoPath 2003 form template to InfoPath 2010, you must change its form type from InfoPath 2003 Filler Form to InfoPath Filler Form. After you have done this, save the form template to disk as a new file elsewhere to keep your old InfoPath 2003 form template intact, because you will still need the old form template to compare functionality and see the JScript code while converting the functionality of the form template.

Because you cannot edit JScript code in InfoPath 2010 and because it is not supported in web browser forms, you can remove the code from the form template just like you would do in InfoPath 2007.

Where the Meeting Agenda form template is concerned, there is JScript code that does the following:

  • Set the dates to the current date when loading the form.
  • Switch to the Minutes View when loading the form and if the meeting end date lies in the past.
  • Renumber the agenda items whenever a new repeating section is added.
  • Send an email containing the form in the body of the email to a list of recipients with a subject taken from one of the fields on the form.

All of the preceding functionality can be created in InfoPath 2010 without writing a single line of code:

  • You can use the today function to set the dates.
  • You can use a Switch Views action on the Form Load with a condition that is based on the end date.
  • You can use the count function to renumber the agenda items.
  • You can use an Email Submit connection to send the form to a list of email recipients.

These are all basic InfoPath actions which you will find explained in depth in the InfoPath 2010 Cookbook so I won’t repeat the step-by-step instructions to create such functionality here.

After you have converted all of the JScript code to equivalent codeless functionality in InfoPath 2010, your conversion process is done. The new InfoPath 2010 meeting agenda form template should now function the same way as the old InfoPath 2003 meeting agenda did, but then without code.

I successfully converted both the Meeting Agenda and Purchase Order form templates to InfoPath 2010 without writing code, although the Purchase Order form template requires code for adding and deleting an optional section if you really want to maintain the functionality 1-on-1.

Note that InfoPath 2003 form templates may not be fully compatible as InfoPath 2010 browser forms (due to changes in the way views are set up internally) and that you may have to completely recreate form templates from scratch (as demonstrated in the video below) if you want to publish them to SharePoint as browser forms.

 


Related Posts

 

Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author.

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013

InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners

InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010

InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers

InfoPath 2010 Cookbook 4: 101 Code Recipes for VB Developers

InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services