Tuesday, December 11, 2007

InfoPath Forms with Workflow in SharePoint

Build the InfoPath Form (Non-repeating table) Normal:

Uses web service to retrieve the parent and child data source. Reference: http://blogs.msdn.com/infopath/archive/2006/10/12/cascading-dropdowns-in-browser-forms.aspx

UDC File (Database)

<?MicrosoftWindowsSharePointServices ContentTypeID="0x010100B4CBD48E029A4ad8B62CB0E41868F2B0"?>
<udc:DataSource MajorVersion="2" MinorVersion="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udc="http://schemas.microsoft.com/office/infopath/2006/udc" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-03-23T08:18:13" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003">
 <udc:Name>abc</udc:Name>
 <udc:Description>abc abc</udc:Description>
 <udc:Type MajorVersion="2" MinorVersion="0" Type="Database">
 <udc:SubType MajorVersion="0" MinorVersion="0" Type=""></udc:SubType>
 </udc:Type>
 <udc:ConnectionInfo Purpose="ReadOnly">
 <udc:SelectCommand>
 <udc:ConnectionString>
 Provider=SQLOLEDB.1;Persist Security Info=True;User ID=user_id;Password=password;Data Source=tor_interact;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False;Initial Catalog=survey_info
 </udc:ConnectionString>
 <udc:Query>
 SELECT *
FROM dbo.ABC
 </udc:Query>
 </udc:SelectCommand>
 </udc:ConnectionInfo>
</udc:DataSource>

 

UDC File (Web Service)

<?MicrosoftWindowsSharePointServices ContentTypeID="0x010100B4CBD48E029A4ad8B62CB0E41868F2B0"?>
<udc:DataSource MajorVersion="2" MinorVersion="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udc="http://schemas.microsoft.com/office/infopath/2006/udc" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-03-23T08:18:13" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003">
 <udc:Name>abc</udc:Name>
 <udc:Description>abc abc</udc:Description>
 <udc:Type MajorVersion="2" MinorVersion="0" Type="WebService">
 <udc:SubType MajorVersion="0" MinorVersion="0" Type=""></udc:SubType>
 </udc:Type>
<udc:ConnectionInfo Purpose="ReadOnly">
 <udc:WsdlUrl>http://abc/WebService/RetrieveData.asmx?wsdl</udc:WsdlUrl>
 <udc:SelectCommand>
 <udc:ServiceUrl>http://abc/WebService/RetrieveData.asmx</udc:ServiceUrl>
 <udc:SoapAction>http://abc/WebService/RetrieveData/GetData</udc:SoapAction>
 </udc:SelectCommand>
</udc:ConnectionInfo>
</udc:DataSource>

 

InfoPath Form

 

Publish the form to the sub-site's form library resides in the document library.

 

Build the InfoPath Form (Repeating table) Administrator-approved:

Uses code-behind to build the data source for the child.

Keep the web service as it is.

InfoPath Form:

 

Publish the administrator-approved form:

  1. Go to Central Administrator > Application Management. Select ‘Manage Form Templates’ in the ‘InfoPath Forms Services’ section.
  2. Click on ‘Upload Form template’. The admin must browse to the location where the InfoPath form was stored by the developer.
  3. Open the context menu of the uploaded file in the Form Templates List. Select ‘Activate to a Site collection’. This will publish the InfoPath Form as a Site Content Type to a site collection.
  4. Go to the site collection on which you activated the InfoPath form template. Open the list where you want to install the form template.Click on Settings and select ‘Site Settings’. Click on ‘Advanced Settings’ in the ‘General Settings’ section and activate the content type management. (select ‘Yes’)
  5. Now you will be able to manage the Content Types. Click on ‘Add from existing site content types’ to add the activated Form Template as Site Content in this list.
  6. Go back to your list and Click on the ‘New’ Button to start a document based the uploaded Form Template.

Workflow Setup:

Go to the Forms Library > Settings > Form Library Settings > Workflow settings