Home > InfoPath2010, SharePoint 2010, Workflow > How to create initiation form for SharePoint2010 workflow part2

How to create initiation form for SharePoint2010 workflow part2

In the last post, I have shown you how to create Asp.net initiation form. In this post I will show you how to create the same initiation form using InfoPath. You can download the complete solution here.

1. Create an empty form using InfoPath2010

2. Add the a label, textbox and a button to the form

3. Add the following rules to the Start workflow button.

a. Add a Submit data action

b. click the add button and add a new connection

c. Choose the “To the hosting environment, such as an ASP.NET page or a hosting application.

d. Click OK to add the submit data connection.

e. Add the close form action and you are done with the rules.

4. Publish the form to the network and deploy the form to the SharePoint. You can find the details instructions in my previous blog.

5. You need export the InfoPath form and generate the code to get the data from the form.

a.Go to File >> Publish >> Export Source Files

b. Open visual studio Command prompt

c. Run the following command to generate the code:

xsd mychema.xsd /c /l:cs

6.Add the myfields.cs to the project under workflow node.

7. Modify the elemets.xml file in your custom workflow, as below.

8. You can get the FormURN by going to File >> Form Info >> Form template properties and the ID field is the current form URN.

9. Now, go to your workflow designer and bind your History description to a new property.

10.In the workflow activated event handler , write the following code.

11. Deploy your solution and invoke the workflow and you will see the InfoPath form Initiation Form

Advertisements
  1. kwasi Denkyira
    May 21, 2012 at 12:02 pm

    This is exactly what I am looking, but my issue is in my case I am using a dropdown list instead of a textbox. How do I log base on an item selected from from the dropdown list

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: