Showing posts with label InfoPath. Show all posts
Showing posts with label InfoPath. Show all posts

Deployment Steps For InfoPath Form During Migration


  • SharePoint Enterprise Edition 2013
  • Microsoft InfoPath Designer 2013
  • An account to access the SharePoint 2013 Site as Site Collection Administrator
  • Visual Studio 2012


Step 1 :- Open InfoPath Form:

Open the 2007 InfoPath template (XSN file) with InfoPath Designer 2013

Step 2 :- Go to Form Options:

File->Options->Form Options

InfoPath1.png 

Step 3:-Set Full trust for the form Security and Trust

 InfoPath2.png
Step 4:-Set Code path and Target Version for InfoPath.

In Our case we had a code behind for the InfoPath form, so set the project file under Programming.
Target of the Form should be InfoPath in the Target dropdown.

InfoPath3.png 

Step 5 :- Change Compatibility

Change the Form type from Web Browser Form (InfoPath 2007) to Web Browser Form and set the Url of the site.

InfoPath4.png 

Step 6:- File -> Publish-> SharePoint server
InfoPath5.png 


Step 7:- Give the URL of the site where this form needs to be published.

InfoPath6.png 
  
Step 8 :- Click on next and select Administrator-approved form template

InfoPath7.png 


Step 9 :- Click Next, Configure the path where the form needs to be published

InfoPath8.png 

Step 10:- Click Next

InfoPath9.png 

Note: User can modify the InfoPath fields here, if required.

Step 11:- Click Publish

InfoPath10.png 

Step 12:- After its successfully published, click Close

InfoPath11.png 


Command to deploy the form to central admin (as earlier it was deployed to central admin)
Install-SPInfoPathFormTemplate -Path "Path of the xsn file"
Enable-SPInfoPathFormTemplate -Identity "Agreement Form.xsn"  -Site "SiteCollectionUrl"

If you want to re-deploy in the same farm, follow these commands:

  1. Disable-SPInfoPathFormTemplate -Identity "Formname.xsn" -Site "SiteCollectionUrl"
  2. Uninstall-SPInfoPathFormTemplate -Identity "Formname.xsn"
  3. Install-SPInfoPathFormTemplate -Path "Path of the xsn file"
  4. Enable-SPInfoPathFormTemplate -Identity "Agreement Form.xsn"  -Site "SiteCollectionUrl"



Form will be deployed to Central Admin.

Challenges faced during InfoPath form Migration from Moss 2007 to SharePoint 2013

Challenge 1:
During Migration from Moss 2007 to SharePoint 2013 - all  old infopath forms that exists in Form/Document  library were opening /working  with new InfoPath 2013 form, but People picker does not contain any value.

Note:-
This is due to schema structure of People Picker control has changed from Moss2007 to SharePoint 2013.

Resolution:
Since the people picker in InfoPath 2013 is changed, we had to add extra namespace to all people picker tags in the InfoPath xml files in the library.

Example: Project manager people picker was not having any value in the form.
Before adding namespace
<my:project_manager>
<my:Person>
<my:DisplayName>xyz</my:DisplayName>
<my:AccountId>domain\xyz</my:AccountId>
<my:AccountType>User</my:AccountType>
</my:Person>
</my:project_manager>

After adding namespace
<my:project_manager>
<pc:DisplayName>USer Dispaly Name</pc:DisplayName>
<pc:AccountId>Domain\user</pc:AccountId>
<pc:AccountType>User</pc:AccountType>
</pc:Person>
</my:project_manager>

Once the above change has been done to all old xml files using PowerShell script, People Picker started working fine.

Challenge 2:

In continuation of above Custom Migration from Moss 2007 to SharePoint 2013  article:-

I need to deploy the custom workflow which was associated with Info Path Form. As I migrated info path and workflow successfully. It was not working as expected.

​After doing lots of R&D, I got the solution and explained below:-

Resolution:

In the Nutshell :- Custom Workflow code was using an entity class file auto generated for InfoPath XSD file. As People Picker control scheme has changed from Moss 2007 to SharePoint 2013. So I need to update the entity class accordingly.

Generating new entity class
To generate the entity class for .xsd file we need to use the XML Schema definition tool (Xsd.exe)
Reference links:

Once you have the SDK Installed(either Manually, or with Visual Studio), you'll find it in the following directories:
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools

Run the command as
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools>xsd.exe
/c /l:cs myschema.xsd BuiltInActiveXControls.xsd

Note: myschema.xsd is file name of InfoPath and BuiltInActiveControls.xsd was needed for new people picker in InfoPath 2013

This will generate the entity class for the .xsd file of InfoPath. Then replaced this with old entity class carefully and check if only people picker classes has changed and deployed the solution.
Now workflow started working as expected.

Note: 
Resolving Issue with People Picker In InfoPath Form

​Since picker schema in InfoPath 2013 has changed, so we have to remove existing people picker and add new people picker from InfoPath 2013 also.