Friday, 17 December 2010

Deploying InfoPath forms to SharePoint production environment


In one of my recent projects I had an interesting problem moving InfoPath 2007 form from my development environment to the production. Actually browser compatible InfoPath form was a part of the system implemented with SharePoint 2007.

Deploying InfoPath forms should not be a big deal, besides Microsoft provides quite detailed guidelines for deploying InfoPath 2007 Form Templates (http://msdn.microsoft.com/en-us/library/cc704269(v=office.12).aspx).   Approach described in that article works fine but it requires InfoPath designer installed in production environment. In my case InfoPath designer was not available in the production. Things are getting even trickier when InfoPath form is not a simple one but it has data connections to external sources, “code-behind” plus it should be browser-compatible. 

So here is the approach that I found out to meet requirements to the production environment when deploying browser-enabled InfoPath template with external connections and “code-behind” to production SharePoint server:
  • Obviously all data connections should be converted into a Universal Data Connection (UDC) files. A UDC file stores data connection settings and resides in a SharePoint Server data connection library (DCL). So initially I created those data connections in local data connection library (library in my site collection, in which InfoPath form was used). Then links to DCL in InfoPath form were converted into centrally managed connection library


  • In my development environment I published InfoPath form template for uploading to SharePoint server (URL to my development SharePoint server) and stored it to “a network location”


  • Then I copied deployment package that included published InfoPath template and all UDC files to production server and uploaded form template to production SharePoint server with SharePoint Central Administration application. UDC files should also be uploaded to centrally managed connection library (obviously you need to setup parameters of connections to production resources before uploading those files)
  • Now you can activate uploaded InfoPath template to your site collection and finalize all needed settings to use form template in your application. From this point the form should be working as in your development environment
Some more complexity to those forms was brought by promoted properties. Some of fields in InfoPath form were “promoted” to SharePoint library and accessible in application as library columns.


Basically, the process of deploying InfoPath form with promoted properties is exactly the same as described above. Additionally, fields to be promoted should be mapped to relevant site columns (this can be set in Form Options \ Property Promotion). To guarantee that SharePoint library in production possesses needed columns, relevant site columns were created as a part of deployment script and associated with forms library. When InfoPath form is being uploaded to the server and activated to a site collection it just links to the previously installed site columns by their names.

No comments:

Post a Comment