Design a form to respond to a workflow status InfoPath 2007
Author: mety Labels:: Design a form to respond to a workflow status InfoPath 2007You can design Microsoft Office InfoPath forms to display specific data that corresponds to the current status of a workflow. You do this by designing a form template to use 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.) that initiate an action in its forms based on the status of the workflow. This can streamline the processes that people use to fill out forms. This article describes how to design an expense report form template to automatically display different views (view: A form-specific display setting that can be saved with a form template and applied to form data when the form is being filled out. Users can switch between views to choose the amount of data shown in the form.) of the form template, depending on the status of an associated Approval workflow. For example, before the workflow is started, the form will display an Expenses view that contains a repeating table where users can enter expenses. When the workflow status is In Progress, the form will display an Expense Summary view that shows the total expenses in each category. When the workflow status is Completed, the form will display the Completed view, which includes details on estimated reimbursement times. To enable forms to respond to workflow statuses, you must perform tasks on the Microsoft Office SharePoint Server 2007 site or Microsoft Windows SharePoint Services 3.0 site, where the forms are located, and tasks in InfoPath. On the SharePoint site you must create a workflow and a site content type (content type: A reusable group of settings for a category of content. Use content types to manage the metadata, templates, and behaviors of items and documents consistently. Content types are defined at the site level and used on lists and libraries.), and in InfoPath you must add a data connection to a form template, create a rule, and publish the form template. Note This article uses an example scenario in which a form template is published as a site content type. You can also publish a form template to a shared network location or create a new document library when you publish a form template to a SharePoint site Introduction to using workflows with InfoPath formsWorkflows help people collaborate on documents and manage project tasks by implementing specific business processes on documents and items in a Microsoft Office SharePoint Server 2007 site or Microsoft Windows SharePoint Services 3.0 site. Workflows help organizations adhere to consistent business processes, and they also improve organizational efficiency and productivity by managing the tasks and steps involved in specific business processes. This lets the people who perform these tasks concentrate on performing the work rather than managing the workflow.You can enable an InfoPath form to display specific data that corresponds to the current status of a workflow. You do this by designing a form template to use 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.) that initiate an action in the form based on the status of the workflow. This can streamline the processes that people use to fill out forms. For example, you can enable a form to display a read-only view when the status for a workflow is Complete and, therefore, the data in the form should not be changed. Workflows must be added to a SharePoint list, library, or content type to make them available for use on InfoPath form templates. The available workflows for a site also vary depending on the type of site and whether custom workflows were created by using Microsoft Office SharePoint Designer 2007. This article uses the Approval workflow to illustrate how workflows can be used with InfoPath form templates. The Approval workflow routes an InfoPath form that is saved to a library to a group of people for approval. By default, the Approval workflow is associated with the Document content type and is automatically available in document or form libraries. Each workflow is defined by distinct statuses with descriptive names, such as In Progress. The names for statuses vary according to the type of workflow. For example, an Approval workflow — which is available on servers running Microsoft Office SharePoint Server 2007 — includes a status for In Progress, Canceled, and Completed. The statuses of a Three-state Workflow — which is available in Windows SharePoint Services 3.0 — can be defined by the person who adds the workflow to a library or list, whereas other workflows use standard statuses such as the In Progress status noted previously. Although the descriptive name is visible to the user, workflow statuses are represented programmatically by numeric values. To design a form template to respond to a specific workflow status, you must know the numeric value for the workflow status that you want to use. This is because InfoPath uses the numeric value of the workflow to initiate an action, such as switching views. As noted earlier, you can enable an InfoPath form template to display specific data that corresponds to the current status of a workflow. Although this article describes how to enable an expense report form template to automatically display a specific view depending on its status in the workflow, you can also customize the workflow by adding additional actions. For example, instead of enabling forms to display a specific view, you can enable them to display a dialog box message that shows instructions. And instead of using an Approval workflow, you can use the Three-state workflow. Note If you enable actions other than those described in this article, you may need to perform additional steps to help ensure that your form template works correctly with the workflow that you use. Compatibility considerationsIf you plan to create a browser-compatible form template (browser-compatible form template: A form template that is designed in InfoPath by using a specific compatibility mode. A browser-compatible form template can be browser-enabled when it is published to a server running InfoPath Forms Services.), keep in mind that the document action bar, which is visible when filling out forms in Microsoft Office documents, including InfoPath forms, is not visible in browser-compatible form templates that users fill out in a Web browser. However, you can still use browser-based forms with workflows. To change the workflow status for such forms, workflow participants can use the document library settings. Find more information about changing workflow settings by using SharePoint sites in the See Also section. Before you beginEnsure the following before performing the tasks in this article:
Step 1: Add an Approval workflow to a library Note This scenario focuses on the Approval workflow, but you can use another workflow type if you want. If you use another workflow type, the options for that workflow may differ from those described in this article.
Step 2: Add a data connection to a form templateThe following procedure explains how to add a secondary data connection that queries the workflow status of the workflow that you added in Step 1. This secondary data connection provides the data that enables rules in the form to switch views according to the status of the workflow.
Step 3: Add a rule to a form template to display a specific viewWhen you design a form template, you can use rules to automatically display a dialog box, set a field's value, query or submit form data to a data connection, switch views, or open or close a form in response to certain events and conditions. The events can include a change to a particular field or group in the 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.), the click of a button, the insertion of a repeating section (repeating section: A control on a form that contains other controls and that repeats as needed. Users can insert multiple sections when filling out the form.) or row in a repeating table (repeating table: A control on a form that contains other controls in a table format and that repeats as needed. Users can insert multiple rows when filling out the form.), or the opening or submission of a form. The conditions can include calculations, XPath (XML Path Language (XPath): A language used to address parts of an XML document. XPath also provides basic facilities for manipulation of strings, numbers, and Booleans.) expressions, and user roles (user role: A predefined category that can be assigned to form users based on job title or some other criterion. Roles are typically used to present customized versions of a form to different types of users.). The conditions can also include whether the value of a field is blank, is within a specified range, equals the value of another field, or starts with or contains certain characters. In this case, you will create a rule to switch views based on the workflow status.
Step 4: Publish a form template as a site content typeWhen you publish a form template, you can either publish it to a document library or publish it as a site content type that can be used in multiple document libraries across a site collection. Because you already created a document library and assigned a workflow to it, you must publish the form template as a content type. Later, you can associate the form template's site content type to the library that you created. Note In addition to publishing a form template as a site content type, you can also publish a form template to a shared network location or create a new document library, when you publish a form template to a SharePoint site. Find more information about publishing form templates in the See Also section.
Step 5: Add a content type to a document libraryContent types (content type: A reusable group of settings for a category of content. Use content types to manage the metadata, templates, and behaviors of items and documents consistently. Content types are defined at the site level and used on lists and libraries.) make it possible for organizations to organize, manage, and handle content more effectively across a site collection. By defining content types for specific kinds of documents, an organization can ensure that each of these groups of content is managed more effectively. You can set up a list or library to contain items of multiple item types or document types by adding content types to the list or library. Note To add content types to a list or library, you need at least the Design permission level for that list or library. Before you begin, make sure that the library is set up to allow multiple content types.
Now, when a user creates a new form in this library, the view of the form will display according to the status of the workflow. |