How to pass InfoPath form fields to SharePoint workflow but hide from Document Library item properties

Challenge:

Create a form in InfoPath 2007 and implement a SharePoint Workflow to it for approval processes. In each step, a Status field in the InfoPat form should be updated automatically according to the change of workflow task status. So a different view in the InfoPath can be opened based on the Status field in the form.

But after the InfoPath was published to the SharePoint (MOSS 2007 with InfoPath Form Services turned on) as Document Library and Content type, the Status field could not be displayed when “Set Field value in Current item” action was selected in the workflow design. Even it was promoted to be available in the SharePoint document library.

To allow your InfoPath form fields can be updated by the Workflow but not the SharePoint document library item editing directly, you have to do the following:

1), In SharePoint Designer, make sure you enable these fields to be edited by using datasheet or properties pages while you are publishing the InfoPath form to SharePoint site.

2), Hide these fields in the document library on SharePoint site.

First, let us enable them while you are publishing the InfoPath form.

Every other steps in the Publishing Wizard are the same as the usual. And it does not matter you publish this InfoPath form as document library or Content Type.

But when you reach the Choose Columns step, you need do one more side-step: highlight the field you need to update with SharePoint workflow (in my case, the field of Request Status as the figure below), then click Modify… button on the right.

image

And on the next Select a Field or Group window, remember to check Allow users to edit data in this field by using a datasheet or properties page checkbox at the bottom.

image

After you click the OK button, you will see the following warning message. Just simply click OK again to back to the Publishing Wizard.

image

And you finish the step above, you should be able to see this field Request Status in the dropdown list when you use Set field value in the current item action in your workflow design.

Now, we need to disable this field to prevent SharePoint visitors from changing this field value directly on document library.

To accomplish this, you need to turn on Content Type management first.

  1. Document library settings – - > Advance Settings – - > Content Type, select Yes to allow manage content type in this document library.
    image
  2. Then you will find there is an extra section in the Document Library setting page. Just click first Form link (assume you do not other content type here) and go to the Content Type setting page as the below.
    image
  3. From the above Content Type setting page, you will see the Columns list. If you already enabled the field (in my case, Request Status), there will be a hyperlink attached to the column name. Just click the link to edit that column. (Remember, you can only hide the column from being edited on the Content Type columns list, not the regular columns list on the Document library setting page).
  4. On the next  Change List Content Type Column page, select Hidden option in the Column Settings section.

image

In this way, this InfoPath form field can only be updated by the SharePoint workflow as you designed, not from the document library item properties page.

  • Share/Bookmark
Tags: , , , ,

Related posts

0 Responses to “How to pass InfoPath form fields to SharePoint workflow but hide from Document Library item properties”


  • No Comments

Leave a Reply



Get Adobe Flash playerPlugin by wpburn.com wordpress themes