locked
Custom VS2005 sequential workflow has to read data entered in the IP form fields against which it is kicked. RRS feed

  • Question

  • A custom document library has an infopath form set as content type with 'visible on new button'.

    When someone fills in this form and submits an IP item gets created in this document library. The IP file name is dynamic [concat("xyz ", LastName, " ", FirstName, " ", now())].

    A custom VS2005 sequential workflow which is manually kicked off aganist new files should be able to read data entered in the corresponding IP form fields.  Could you please sugggest how to achieve this.

    Thanks inadvance.
    Monday, November 3, 2008 9:52 PM

Answers

  • When you publish the IP form to SharePoint, you can map an InfoPath field to a SharePoint column.  If you do this, you can easily read this from your Workflow code.  It would look like this:  

    workflowProperties.Item["fieldName"]

    If the field is not mapped to a SharePoint column, you'll need to programmatically open up the form as an XML document and then use an XPath expression to find the node you're looking for.  You can access the IP .xml document as

    workflowProperties.Item.File which returns an SPFile object for the document.

    I'll leave it up to you for opening of the document and consuming its XML.  There are tons of resources on there on how to do this.

    Hope this helps.




    Randy - http://sharepointhawaii.com/randywilliams
    Tuesday, November 4, 2008 8:48 AM