Scenario: I have an InfoPath form that front-ends a workflow process implemented using SharePoint Designer. At one point, a manager must approve the form. Since I cannot count on workflow history to meet my auditing requirements, I decide to store my own auditing message directly on the form itself.
Design the form and publish it as a content type and the form itself to a document library. Mark desired form fields as being updateable from MOSS. The form is tied to the content type and the content type is "attached" to a forms library (or many, if you want). Write a workflow that updates the field.
- Create a document library. This will hold your InfoPath template.
- Create a forms library.
- Create the InfoPath form. Include a text field, "Audit Message".
- Publish the form as a content type (NOT a document).
- While filling out the publishing dialogs:
a) Save the .xsn file to the document library (step #1).
b) Publish the "Audit Message" field and mark true: "Allow users to edit data in this field by using a datasheet or properties page".
c) Create a new content type and give it an appropriate name.
- Access the forms library.
a) Go to its advanced settings and enable the forms library to manage content types.
b) Select the newly created content type (5c above). It will be grouped under "Microsoft InfoPath" (or similar).
c) Remove the default "Form" content type from the library.
d) Mark the library to "show as web page" so that the form will launch from SharePoint and not the InfoPath workstation client.
- Go back to the forms library proper and click "New" to simply verify that the form is posted correctly and acting as you want.
- Fire up SharePoint Designer and navigate to the site that hosts your form library (from step 2).
- Create a new workflow attached to the forms library.
- Add a single action "Set Field in Current Item". You should expect SharePoint Designer to list your your field, "Audit Message". Assign it a value.
- Click Finish and go back to the form library.
- Create a new form and put some test value into the "Audit Message" field.
- Save it and go back to the form library.
- Right-click, select "Workflow" and start up your workflow.
- It should run almost immediately. Pull up the form (from step 12) and if all has gone to plan, "Audit Message" has been assigned whatever value you provided in step 10.
Not all controls may configured for this bi-directional communication. For example, it does not seem to implement an SPD workflow that modifies text fields wrapped inside repeating sections.
One of the key take-away’s here is that we’ve really created a content type with an associated template. This also enables us to store multiple InfoPath form templates in the same form library.
This requires forms server. It’s most certainly not going to work in a WSS 3.0 environment and probably even requires an Enterprise SharePoint environment.