Developing and Deploying Form Templates for InfoPath Forms Services

Developing InfoPath form templates that work with InfoPath Forms Services is supported in Microsoft Office InfoPath 2007 by setting the correct compatibility settings. This can be done when first creating a form template or at any point during the development of the form template. Deploying InfoPath form templates that work with InfoPath Forms Services can be done from within the InfoPath design user interface (UI) if the form template does not contain custom business logic, or by a server administrator if custom business logic is needed.

Using the Compatibility Settings

The compatibility settings of Office InfoPath 2007 control many UI elements when designing a form template, such as which controls are available and warnings about how a specific control may behave in the browser. To create a form compatible with InfoPath and InfoPath Forms Services, click the Enable browser-compatible features only check box in the Design a Form Template dialog box. When designing the form template, notice the compatibility information displayed in the status bar. To change the settings, click the Compatibility category of the Form Options dialog box, which is available on the Tools menu when designing a form template. Open the Design Checker task pane and click the Change Compatibility Settings link to go directly to the Compatibility category of the Form Options dialog box.

Using the Design Checker

The Design Checker task pane displays errors and messages about items present in the form template that may cause problems when deployed to a server running InfoPath Forms Services. Use this information to determine whether your form template will function properly in the browser or if changes need to be made before deployment. Especially if you are upgrading a form template, there may be many controls in the view that are not supported on the server. For more information about what controls are supported in browser-compatible form templates, see Creating InfoPath Form Templates That Work With Forms Services.

For a more complete report on compatibility, check the Verify on server check box below the errors and messages list in the Design Checker task pane. InfoPath contacts a server running InfoPath Forms Services, specified in the Compatibility category of the Form Options dialog box, to return detailed information about the compatibility of the form template. If you do not have access to InfoPath Forms Services, addressing the errors and messages in the Design Checker task pane will allow you to create a compatible form template that can be deployed to a server running InfoPath Forms Services when it is made available.

Important

If you are designing a form to be used in both the InfoPath client and in a browser, and you need to use excluded object model members of the Microsoft.Office.InfoPath namespace when the form is opened in the client, you can hide errors in the Design Checker task pane by clicking the Hide errors for code that uses InfoPath-only features check box on the Compatibility category in the Form Options dialog box.

Deploying Form Templates

Deploying browser-compatible form templates is accomplished through the Publishing Wizard in Office InfoPath 2007. Depending on whether the form template contains custom code will determine who can actually deploy the form template to the site and how it can be deployed.

Deploying Form Templates That Do Not Contain Code or Require Full Trust

If your form template does not contain code or require Full trust, it can be deployed directly to a SharePoint site. This is the first step for turning a browser-compatible form template into a browser-enabled form template, meaning it has been converted by InfoPath Forms Services to be rendered in a browser. To do this, follow these steps:

  1. Open the Publishing Wizard by clicking the File menu and selecting Publish.

  2. The first option in this dialog is To a SharePoint server with or without InfoPath Forms Services. Leave this selected and click Next.

  3. On the second screen of the Publishing Wizard, enter the URL of a SharePoint server that you have at least Contribute rights to, meaning that you can add and delete content on the site, then click Next.

  4. On the third screen of the Publishing Wizard, keep the default settings of Enable this form to be filled out using a browser and Document Library. Note the last option is to create a form for administrator approval, and click Next.

    Note

    If you are publishing a form template that contains code or requires Full trust, select the Administrator-approved form template (advanced) and skip to the Deploying Form Templates That Contain Code section.

  5. On the fourth screen of the Publishing Wizard, keep the default setting of Create a new document library and click Next.

  6. On the fifth screen of the Publishing Wizard, give the document library a name and click Next.

  7. On the sixth screen of the Publishing Wizard, click the Add button to select fields from the form template that will be shown as columns in the document library and in Outlook. This is optional. Once you are done, click Next.

  8. On the last screen of the Publishing Wizard, click Publish. This will deploy the form template to the document library and make it available. After this is done, click the Open this form in the browser link to see the browser-enabled form.

Deploying Form Templates That Contain Code

Administrator approval is required for form templates that contain code or require Full Trust. For reasons of security and manageability, form templates with custom code must be uploaded and activated by someone with Administrator rights to the SharePoint 3.0 Central Administration site. If you do not have these rights, you must find a person who does. If you have these rights, follow these steps to browser-enable a form template that contains custom code.

Finish publishing the form template:

  1. Follow the steps above until you get to step four, which is through the third screen of the Publishing Wizard. Here, select Administrator-approved form template (advanced) and click Next.

  2. On the fourth screen of the Publishing Wizard, type a location and filename for the form template (.xsn) file. This can be on your local hard drive, a network file share, or a Web server. Click Next.

  3. On the fifth screen of the Publishing Wizard, click the Add button to select fields from the form template that will be shown as columns in the document library and in Outlook. This is optional. Once you are done, click Next.

  4. On the last screen of the Publishing Wizard, click Publish. This saves your form template (.xsn) file to the location you specified, and it is now ready to be uploaded to the server.

Upload the form template to the server:

  1. Open the SharePoint 3.0 Central Administration site.

  2. Click the Application Management link.

  3. Under InfoPath Forms Services click the Manage form templates link.

  4. Click the Upload form template link near the top of the page.

  5. Click the Browse button to open a dialog box, and enter the path to the published form template.

  6. Click the Verify button to verify that the form template does not contain any errors. This step is optional.

  7. Click the Upload button to upload the form template to the site. Once this is done, click the OK button.

Activate the form template to a site collection:

  1. On the Manage Form Templates page, locate the form template you uploaded.

  2. Click the drop-down and select Activate to a Site Collection.

  3. In the Activation Location section, click the drop-down and select Change Site Collection.

  4. On the Select Site Collection dialog box, click the Web Application drop-down and select Change Web Application.

  5. Click SharePoint - 80. This should be the name of your default SharePoint server. If not, select your default SharePoint server.

  6. Click the site collection name that you want to activate the form to, and then click OK.

  7. On the Activate Form Template page, click OK.

  8. Alternatively, activating a published form template can be done from the site collection administration page. Select Site Collection Features, locate the form template, and click the Activate button.

Once a form is activated to a site collection, it is available for use and listed in the Form Templates document library.

See Also

Other Resources

Developing InfoPath Managed Code Form Templates
How Do I...In InfoPath Managed Code Form Templates
About the Security Model for Managed Code Form Templates
How to: Preview and Debug Managed Code Form Templates that Require Full Trust
How to: Configure Security Settings for Managed Code Form Templates