1/30/12

InfoPath 2010 - Sharepoint 2010 Custom Workflow Part 1

Workflow is one of the core features in Sharepoint, it is very flexible and very powerful, a handful of workflows are included out of the box but the real power of workflow is in custom workflows. For this example I'm going to create a new sequential list workflow that will create a new site collection when a InfoPath 2010 Form is submitted to a list that is running my custom workflow. The workflow will be initiated upon form submit but will not create a site collection until the site name list field is populated. The custom workflow will be deployed as a site feature.

In Part 2 I'll create a new Visual Studio solution for the custom workflow project, the project will include some exception handling in case any errors occur so I can see the output from the exception(s).

Prior to creating the Visual Studio project the following items need to be in place.

1. A demo Site Collection where the solution will be deployed
2. A customized forms list where I'll attach the workflow

Create the Sharepoint Site and List

First create a new site collection where the workflow will be deployed. Once this is in place create a new list, choose Site Actions - View All Site Content | Create. Select the Issue Tracking list type from the available list templates, for this example I will name the list Issues.

Once the Issues list has been created select the list and from the list tab in the ribbon choose customize form, this will open the form in InfoPath.


All of the default fields are ok for this example but we'll need to add a SiteName field to the form. I'll replace the Issue Status default field with the Site Name that I need for the custom workflow. Select the Issue Status text from the labels in the left column and change the text to Site Name, then select the dropdown to the right and delete this dropdown control.

Next with your cursor still in the area where the Issue Status dropdown control was double click the textbox control on the Home tab of the ribbon on the top of the page. This will add a new textbox control to the form.















The new textbox should be given a value of field1 by default. From the Fields dialog on the right side right click on the field1 property and select field properties.


Enter SiteName in the Display Name and Name properties, select ok.

Next select File and choose Quick Publish to save the changes to the form in Sharepoint.


This completes part 1, in part 2 I'll create the Visual Studio Solution with the custom workflow

No comments:

Post a Comment