I have somehow managed to break my infopath form :( When I try to open it (both preview mode and design mode) I get the following error: InfoPath cannot open the following form D:\infopath\formname.xsn. The form definition (.xsf) file contains errors.
When I click on more details I get this:
The form definition (.xsf) file contains elements, attributes, or structures that are not valid.
Error details:
The keyref 'ruleSet_5' does not resolve to a key for the Identity Constraint '{http://schemas.microsoft.com/office/infopath/2003/solutionDefinition}ruleset_name_key'.
Line 232, Position 3
</xsf:xDocumentClass>
--^
Is there any way to resolve this? Or is my only option to re-create the form? Thanks in advance for any advice!
Edit the .xsf file manually and remove any reference to "ruleSet_5" and save. Try to re-open form.
If not remove the container XML node of "ruleSet_5".
Yep - seen this a couple times...
You'll need to edit the manifest.xsf. In fact, an InfoPath form is an archive, so rename the .xsn template to .cab, and extract in the normal way. Now edit the manifest.xsf to remove the reference to the keyref on line 232.
Finally, rebuild your form, by right-clicking on the manifest.xsf and selecting design (You may find there are more than one errors - you're only seeing the first one reported back, so you may need to repeat the above for each error). Finally, you'll need to republish.
I also faced this issue, tried to edit xsf (saved form in local drive, renamed to cab, and extracted in the folder) but there was no reference to error. Another file UpdateItem.xls had the reference to the error, I removed that but after that was not sure how to rebuild the form. Tried to zip the folder again, rename to xsn, but didn't work.
Finally, I figured out that one of the "views" in the form still referenced the deleted data connection. So, if the form has multiple views (Edit, Display, etc.) - Check in Page Design tab, first section in Ribbon - cycle through all the views and check that none of the views has reference to deleted data connection.