Friday, January 19, 2007

Walkthrough: Publishing administrator-approved form templates

A. Steps at client-side (for InfoPath developers)

  1. Create an InfoPath form and use managed code (C#) as business logic.The business logic needs full trust on the server to run.

  2. Save your form and publish it to a SharePoint Server with or without InfoPath Forms Services

  3. If you opt for ‘Document Library’ a library will be created or updated and the template can only be used in this library. If you opt for ‘Site Content Type’, you can use your template in multiple document libraries on several sites. A site content type is nothing more than a type of document with some specific properties.
    In this situation you cannot opt to create a document library or a content type because you used managed code. You must select ‘Administrator-approved form template (advanced)’. We need the ‘full trust’ security level to run .NET code.


  4. We can’t publish the form directly on the Sharepoint Server. First of all we must store the InfoPath form to a location which is accessible for the administrator.



B. Steps at server-side (for administrator)

  1. Go to Central Administrator > Application Management. Select ‘Manage Form Templates’ in the ‘InfoPath Forms Services’ section.

  2. Click on ‘Upload Form template’. The admin must browse to the location where the InfoPath form was stored by the developer.

  3. Open the context menu of the uploaded file in the Form Templates List. Select ‘Activate to a Site collection’. This will publish the InfoPath Form as a Site Content Type to a site collection.

C. Steps at server-side (for site owners)

  1. Go to the site collection on which you activated the InfoPath form template. Open the list where you want to install the form template.Click on Settings and select ‘Site Settings’. Click on ‘Advanced Settings’ in the ‘General Settings’ section and activate the content type management. (select ‘Yes’)

  2. Now you will be able to manage the Content Types. Click on ‘Add from existing site content types’ to add the activated Form Template as Site Content in this list.




  3. Go back to your list and Click on the ‘New’ Button to start a document based the uploaded Form Template.

4 comments:

Zac Boyles said...

Beautiful article. The main thing after this though would be the means in which the form is updated. Which form do we design, the original or the file that is saved to a network location? Also, what are the steps to have the form in the list display the changes?

Kristof De Causemaeker said...

Zac,

You can develop the InfoPath form on the original location or on the network location (which is accessible for the admin).

The point is that InfoPath just publish the form temporarily to a network location. You can modify the form on that location without any problem.

grtz
Kristof

Zac Boyles said...

Ok cool, I didn't know if all the version messages would be poping up or not. Also, what I was hoping is that once the Admin (me) uploads the approved template, I would be able to publish directly to the library. I am know imagining that this is not the case.

Braden Callahan said...

This helped me a ton, I wrote up my own version of a checklist that might helpd some of the commented questions:

How to Publish and use InfoPath Forms with Managed Code on InfoPath Forms Server