Tuesday, October 25, 2011

What are Template Parts?

It’s a kind of reusable sections in Infopath forms.

A template part is a portion of a form template that can be saved for reuse in multiple form templates. A typical template part consists of controls and a data source (data source: The collection of fields and groups that define and store the data for an InfoPath form. Controls in the form are bound to the fields and groups in the data source.) and may also include features such as data connections (data connection: The connection between an InfoPath form and an external data source, such as a database, Web service, SharePoint library, or XML file. Data connections are used to query and submit data.), data validation (data validation: The process of testing the accuracy of data; a set of rules you can apply to a control to specify the type and range of data that users can enter.), and rules (rule: A condition or action, or a set of conditions or actions, that automatically performs tasks based on events and values in the form.).
By creating and using template parts, you can help ensure that the form templates in your organization are consistent in tone, structure, and behavior. For example, a human resources department might use a single "Contact Information" template part in all of its form templates.

The file extension for template part is .xtp.

To design a template part, you must select the Template Part option instead of the Form Template option in the Design a Form Template task pane. When you open a template part, a (Template Part Design) prefix appears in the InfoPath title bar, indicating that you are in the correct mode for designing a template part.

Unlike a form template, you don't publish a template part when you finish designing it. Instead, you save it as a template part (.xtp) file. Then you can make your .xtp file available to other form designers who will need to use it. For example, you can copy the .xtp file to a file server on your organization's network and then send an e-mail message to form designers that describes the purpose of the template part, where it is located, and how they can add it to the Controls task pane in InfoPath.

When a form designer inserts a template part on a form template, it becomes part of the form template, and a form designer can customize it, if necessary.

Note There is no way to prevent form designers from changing a template part after they insert it on a form template. If you don't want others to customize the template part, you should make that clear when you distribute it.

To insert your template part on an InfoPath form template, form designers must first add the template part to the Controls task pane by using the Add Custom Control Wizard. After they complete the wizard, the template part appears in the Controls task pane, under the Custom heading.

To modify a template part, you open it in InfoPath design mode, make the changes that you need, and then resave the template part. You must then send the updated template part to any form designers who used the original version of the template part. Form designers can use the Add Custom Control Wizard to add the updated version of the template part to the Controls task pane. After they do this, they can open each affected form template and have InfoPath replace the original template part with the newer version.

Note If your organization creates a large number of template parts, you can build a repository of template parts that can be accessed from a common location on a company network, such as a shared folder, a Web server, or a form library located on a Microsoft Windows SharePoint Services site. It is possible to configure the InfoPath settings in the registry so that template parts appear automatically in the Controls task pane for users who have InfoPath installed. To make this happen, you may need to work with your information technology (IT) department, or with someone who is responsible for administering InfoPath in your organization. For more information about this topic, see the InfoPath documentation on Microsoft TechNet. TechNet is the resource that IT professionals use to successfully plan, deploy, manage, and support Microsoft products.

No comments:

Post a Comment