InfoPath Form Library doesn’t allow to save any changes

Sometime InfoPath form library doesn’t allow to save the changes made to list item.

It throws following error:-

ExceptionType: ‘SPException’ ExceptionMessage: ‘Changes could not be saved into the
document.
The property to change is read-only for the document’s content type, or the
document is missing XML elements
or attributes where the changes would be saved.
Try editing the document  in a Windows SharePoint Services-compatible XML editor
such as Microsoft Office InfoPath.

This problem happens when the Form Library contains several property promoted fields
and the form for which changes were made and supposed to save , doesn’t contains those
fields and blows up when trying to save.

To fix this issue, double check content type definition and linked field associated with that.

Some time problematic field got created, doesn’t remove just by deactivating/Uninstall of
feature because instance got created.
This is important to find the instance and remove it then use feature to install/activate to work properly.

Action Item to resolve this issue:-

To fix the problematic filed which blows up,
1. Create a unit test to identify the fields used in Infopath Form
2. Now Remove the filed column mapping from the content type associated in a list
3. Similarly remove the field mapping from content type in Site Collection
4. Remove the content type from the Site Collection
5. Redeploy the content Type so that the Push Down mechanism will update the child
content type

And this solved the problem.

Problem with multiple Infopath forms Associated to a Forms library.

In Forms Library some time field with type Note does not accepting
long text  for some InfoPath form and on the same time it accepts
long text for other InfoPath form.

It will give following error

ExceptionType: ‘SPException’ ExceptionMessage: ‘Invalid text value
A text field contains invalid data. Please check the value and try again.’

This types of problem occurs to those forms whose Field definition was
not properly associated to Infopath form content type.

To fix this strange behaviour check field definition in infopath form content type.

If the Form Template created using contentype definition then link
the field with that. If was created without content type definition then
go to content type definition gallery and find the content type for the
legacy deployed infopath form which got created when published.

After getting the name of the content type link the Field
and then it will start working  correctly.

Customize StyleSheet for Browser Enabled InfoPath Form

Stylesheet for browser enabled Infopath is located at

~\TEMPLATE\LAYOUTS\INC\ifsmain.css

For example if you want to customize Error dialog box
Modify following css class and see the effect, and can be extended
as per requirement.

 

.errorDiv
{
 z-index:100;position:absolute;
 top:0px;
 left:0px;
 display:none;
 width:300px;padding:2px 3px;
 border:1px solid #B22828;background:#FFFED7;color:#B22828;
 font-family:Verdana;
 font-size:x-small;
 text-decoration:none;font-weight:normal;
 width:50px;
 
}

Automate Infopath Upload – Infopath form not uploaded from Central Admin

I faced gruesome problem when Infopath Form was not getting uploaded
in Production Server thru Central Admin.

After spending lot of time finally started drilling  sharepoint then came to know that whenever  Infopath is getting uploaded it creates feature folder with prefix FT-Guid inside 12 hive feature foldert.

This resolved all problem. In dev machine  uploaded Prod. Infopath Form thru Central Admin then it created folder inside 12 hive feature,  copy the FT-Guid Feature folder move it to production server
Just Install and Activate it to the site and it works like charm.

Using this approach there is no post deployment work to upload InfoPath. Just preaper FT-Guid feature for InfoPath from dev environment and include this along with the deployment package  feature.

InfoPath 2007 Issues with Dynamic WebServices URL

One of the major difficulty with InfoPath 2007 is you cannot set WebServices URL Dynamically.

I found some solution , One suggestion here to change Change on form load but problem here is
you cannot directly publish because it contain code behind.

Another option using Data Connection file again it increase post deployment work also
if the Infopath form has lots of method inside then change every where.
Again if you have multiple form then its huge post deployment work and need to check each
and every functionality.

From MSDN find and replace manifest.xsf file with appropriate url and publish it, this way  no
post deployment work.

Automate Infopath Deployment

Install a new Infopath form template for a site collection:
collection:C:\InfoPathForms\Publish\sample.xsn
cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
::uncomment the below three lines if you want to uninstall and re-install the infopath form template
::stsadm.exe -o DeActivateFormTemplate -url http://SiteNameHere -filename ::C:\InfoPathForms\Publish\sample.xsn
::stsadm.exe -o RemoveFormTemplate C:\InfoPathForms\Publish\sample.xsn
::stsadm.exe -o execadmsvcjobs
stsadm.exe -o verifyformtemplate -filename C:\InfoPathForms\Publish\sample.xsn
stsadm.exe -o UploadFormTemplate -filename C:\InfoPathForms\Publish\sample.xsn
stsadm.exe -o execadmsvcjobs
stsadm.exe -o ActivateFormTemplate -url http://SiteNameHere -filename C:\InfoPathForms\Publish\sample.xsn

Upgrade or update the existing infopath form template for a site collection:
cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
stsadm.exe -o DeActivateFormTemplate -url http://SiteNameHere -filename C:\InfoPathForms\Publish\sample.xsn
stsadm.exe -o verifyformtemplate -filename C:\InfoPathForms\Publish\sample.xsn
stsadm.exe -o UpgradeFormTemplate -filename C:\InfoPathForms\Publish\sample.xsn
stsadm.exe -o execadmsvcjobs
stsadm.exe -o ActivateFormTemplate -url http://SiteNameHere  -filename C:\InfoPathForms\Publish\sample.xsn