InfoPath Forms for Workflows, How to Register Forms in SharePoint 2007

by Daniel Halan 17. July 2007 19:28

Microsoft has published a very good Walkthrough on how to create a Workflow for SharePoint 2007 and using InfoPath Forms for custom user interaction.

But they where a bit vague on explaining the configuration surrounding the InfoPath Forms, as they left out how to register the Form in SharePoint. Here are some clarifications.

- The InfoPath Form Template ID that are used in workflow.xml/Elements/MetaData/*_FormURN elements are found in InfoPath, 
File > Properties. The "Properties" menu item exists only when opening InfoPath in Design-mode, todo that right click on the xsn file and select "Design" in the context menu.

- Before installing your feature it's always good to verify that the published form will work correctly in your SharePoint instance using the StsAdm tool:
"stsadm -o verifyformtemplate -filename MyFeature\MyForm.xsn"
If you have created your Workflow project from the Visual Studio 2005 "SharePoint Server Seq. Workflow" project there is an installation .bat file created called PostBuildActions.bat which contains this line, but it's commented. You just need to uncomment it and change the path to your form.

- When installing the feature you should put the Template Form(s) inside your feature folder. (...\web server extensions\12\TEMPLATE\FEATURES\MyFeature\)

- You need to register your InfoPath Forms in SharePoint, which is done thru the feature.xml, by putting a Property element with the "RegisterForms" directive, and the relative path to the form(s) from your feature folder. This example registers all forms in the feature root folder.

<Feature Id="54178F4E-80E6-4c26-835C-2533060FFD74" .... >
 
<Properties>
   
<Property Key="RegisterForms" Value="*.xsn" />
  </
Properties>
</
Feature>

References:
Walkthrough: Creating Office SharePoint Server 2007 Workflows in Visual Studio 2005
MSDN Articles: InfoPath Forms for Workflows

Blog3ngine dot NET 1.6.1.2
Theme by Daniel Halan

About the author

Daniel Halan Daniel Halan, M.Sc. systems architect in Sweden.

Working primary with Microsoft .NET, Dynamics CRM, XRM & Web Read more...

The content of this site are my own personal opinions and do not represent my employer's view in anyway.


Follow Me
RT @A_Robson: Craftsmanship and Delivery http://bit.ly/dRTKJ8 26 Jan 2011

Microsoft Dynamics Salary Survey 2012

Nigel Frank International would like to invite you to complete our annual survey of global Microsoft Dynamics salaries. The survey will only take a couple of minutes to complete and your response and any personal details will be kept strictly confidential.

Prizes,
1st  iPad2 16gb Wi-Fi + 3G 
2nd Xbox 360 + Kinect 
3rd Kindle Keyboard w/ Free 3G + Wi-Fi 
4th MS LifeCam Studio Webcam 
5th MS Arc Touch Mouse 

You will also receive a FREE copy of the Salary Survey report once it has been compiled. 

Take the Salary Survey 
The survey is available in 12 languages for your convenience.