Infopath Administrator-Approved Forms and K2 processes

... or what is behind the "Publish to: Local or Network Location" in the Infopath Integration Wizard.

In some cases (forms with code behind, or TimeOut on deployement...), it can be interesting to be able to deploy Infopath Forms for a K2 process as Administrator-approved forms in Sharepoint. Here you will find the steps you need to do (or check) in K2 designer, MOSS central administration and in your MOSS site collection to ensure the compliance of your K2 Infopath Form for an execution in your web browser. This article is an additional reading ressource for the excellent HOW TO video on "Using 'code behind' with InfoPath forms, SharePoint and K2" published on the HOW TO K2 blog.

  1. [Using the K2 designer]
    • Change the template deployment location to be on the file system, by loading the Infopath Integration Process Wizard and editing configuration of your attached form:

    • The preceding step allows the K2 Designer to prepare the URL to access worklistitem from your K2 Worklist component. And as we now use a local path, all MOSS configuration needed to access the worklistitem using the web-browser will disappear, so we need to do some updates in each Infopath Client events of the process. To perform this, we need to update the code behind each Infopath Client configuration:
      • First I propose to create 3 environnements fields (1 Sharepoint Server URL for registering the site you will use, and 2 miscellaneous: one to store the name of the Form Library and the other to store if you want to open the form with the web-browser), as per as the screenshot bellow:

        In my example: Infopath FormLib=test, Infopath OpenAsWebPage=True, Sharepoint HR Site URL=http://portal.denallix.com/sites/hr

      • Second, you need to update the code of each client event. To do this, right click on your Infopath Client event >> View Code >> Event Item, then in the code, browse to the SetWorklistUrl method and adapt the following code to your own configuration (see bellow an example):

      • You can re-launch your Infopath Client Event wizards without any fear, your updated code will not be deleted.

  2. [Using the Infopath Designer] Then, enable your form to be filled out by the browser. To achieve this, still using the Infopath Integration Process Wizard, launch the “Design” feature and:
    • Go to the “Tools” menu and select “Form options…”, make some changes in the categories “Compatibility” and “Browser” as per the screenshots below:
      Ensure your form is browser compatible:


      Ensure, you will have some menu buttons (optional if you create your own one):

    • Once this is finished, you can close your form, then you can close the K2 Infopath Integration Process Wizard, and you can deploy your K2 process.

  3. [Using the Infopath Designer] Now, you must deploy your local Infopath form with correct data connections:
    • Browse to the deployment location selected in step 1
    • Find your XSN file, righ-click and then select “Design”
    • To convert all the K2 Data Connections to Universal Data Connection files (your K2 designer do this on its own when it deploys the form to a Sharepoint Library, but here you need to do this manually).
      • In the “tools” menu, select “Data Connections…”
      • Then for each data connections in the list, click on “Convert…”

      • And create your UDCX files in the site collection you want to deploy your form. You will obtain something like:

    • Now you can publish your form:
      • In the “file” menu, select “publish…”
      • When asked where you want to publish your form, choose “To a SharePoint Server with or without InfoPath Forms Services” and click Next.
      • Paste the URL of the document library that you created and click Next.
      • In the following page you must select the “enable this form to be filled out by using a browser” box and the “Administrator Approved form template”. Click Next.
      • Browse to the location you saved your file to and select it. Click Next twice.
      • Click “publish”
      • You will see a message that confirms your form has been published successfully and remind you to give your SharePoint Administrator the information listed on the screen.
      • Click “close”

    • Close Infopath.

  4. [Using MOSS Central Administration] If you are a SharePoint Administrator with access to SharePoint Central Administration, navigate to the Central Administration web site:
    • Choose “Application Management”
    • Under InfoPath Forms Services, choose “Manage form templates”. 
    • On the Manage form templates page, click “Upload form template”.
    • On the “Upload Form Template” page, browse to the location where the template has been saved to (in step 3. before publishing) and select it.

    • Click “Upload” 
    • On the following screen, check that it uploaded successfully, then click “OK”
    • On the “Manage form templates” page, locate your xsn form and wait for the “ready” status (if the status is still “installing”, be sure the SPTimer service is running – you can perform a “net start SPTimerV3” cmd to launch it, and if necessary a “net start SPAdmin” cmd).
    • When it’s “ready” on the template that you just uploaded, click the drop-down box and select “activate to a site collection”.

    • On the Activate Form Template, choose the correct Site Collection to activate it to and click OK.
    • You can now close Central Administration.

  5. [Using Settings of your site collection] Navigate to your Sharepoint site:
    • Browse to your form library.
    • Then click on “form library settings”.
    • In the “Customize” page of your library under “General Settings”, click “Advanced Settings”.
    • In the Advanced Settings Page, select “Yes” under “Allow management of content types”, check if the “Display as Web page” option is checked, and click OK.
    • Back on the Library Settings Page, you should now see a section called “Content Types”. Choose the link “Add from existing site content types”.
    • On the Add Content Types page, change the selection on the Select site content types from drop-down menu to Microsoft Office InfoPath.
    • Select the Content Type of your new Administrator Approved form and click the “Add” button, then click OK.
    • You should now see your new content type listed in the content types list. Optionally you can delete the other content type(s) in the list to avoid confusion regarding  what form should be stored there.

  6. Now when users click the “New” button in the document library, your Administrator-Enabled form will launch in browser mode and when you will submit it the K2 process will be executed.


I hope this will help you to create better K2 web applications ;-).


-- by Jean Cadeau


Posted Thu, Nov 12 2009 10:01 by jan