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.

Advertisements

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.

How to create Infopath Property Promotion Field using Feature

Steps to create Property Promotion field in Infopath form and map it to library :-

1. Open InfoPath form in design mode.
2. Create Property Promotion field from Form Option
3. Save InfoPath form as source.
4. Note down XPath of property promoted field
5. Open XSF file notedown the Guid or Change the Guid based on field    GUID
6. Create Field with node value of as of XPath
7. Deploy  Field in Site
8. Deploy Infopath Form using Custom Content Type and bind field to the Content Type

Now go to the Form Library all the Fileds will be available.   🙂

How to open both Old and New Infopath Template Version in Form Library

In a situation when you want InfoPath XML form containing data required to load in the same version  of the InfoPath form template
it was created with.

After googling I didn’t find any  proper solution, one way I got by publishing using Infopath designer But this approach is not the
smart way to deploy in production environment.

Finally I am able to resolve this issue. 🙂

To solve this problem we need to understand, Infopath form template will not work just by saving inside the SharePoint environment. In order to work it should be properly registered. Read more

To open infopath form in the same version when it was created , change the process instruction “HREF” value pointing  to old version of Infopath form template. In this way whenever infopath form will load it will always take the old Infopath form template
and on click of new it will open latest infopath form template .

The most important part is the deployment strategy, which should be capable enough to maintain both old and new version together.