Showing posts with label SharePoint Forms Services. Show all posts
Showing posts with label SharePoint Forms Services. Show all posts

Friday, 12 March 2010

InfoPath 2007 - Fix for "Operation could not be completed" errors when opening InfoPath form in design view

If your InfoPath 2007 form suddenly stops working in design mode and you start to get the following error when opening the form in design mode:

"Operation could not be completed."

There are a few things you can do to try and fix it:
  1. Remove all the the local cache files from your machine (typically found in C:\Users\USERNAME\AppData\Local\Microsoft\InfoPath) - delete the "Designer2", "Cache2" and temp folders
  2. If that doesn't work, try running the form (e.g. in Visual Studio 2008, just right click on the form project and Click "Debug -> Start New Instance". When it opens, it will correct the project structure or re-add neccessary .NET assemblies to the project. Go to design mode again - and it will all start working (though all the tabs in the Designer window will now open). I suspect this happens if the xsf file is not correctly written to or some of your supporting files are readonly on save.

Thursday, 21 January 2010

Side-By-Side Versioning of InfoPath Browser Based Forms using SharePoint 2007 (aka how to have Multiple versions the same Form in the Same Forms Library)

When you have an InfoPath form live on your server, and you make a change to the schema of the form and upload it over the existing copy, your old forms won't open. You will just get a "Form has been closed" message or another kind of supporting error. To avoid killing off old versions of forms when deploying new versions, you simply have to do the following:
  1. Publish the form with a new name e.g. PurchaseOrderForm_V1-01.xsn using the Publish wizard either in InfoPath of Visual Studio 2008. Note that you cannot just publish and rename it as this will not change the FormId and instead potentially upgrade all your old forms to an incompatible version.




  2. Upload the file to the server via Central Admin > Applications Management > Upload Form Template
  3. Activate the form to your site collection. Look at the properties of the form from the Central Administration > Application Management > Manage Form Templates > View Properties - it should have the version in the form Id (e.g. urn:schemas-microsoft-com:office:infopath:PurchaseOrderForm-V1-01:-myXSD-2009-11-02T03-05-56)
  4. Go to My Form Library (e.g. "Purchase Order Forms" > Settings > Form Library Settings. Where the current content type is used.
  5. Add the new content type PurchaseOrderForm_V1-00 to the list.


  6. Rename the old Content Type (ie the current one in use that you want to preserve) to PurchaseOrderForm_V1-00 (this is typically the Name of the "Parent content Type"
  7. Rename the newly uploaded content type from PurchaseOrderForm_V1-00 to a friendly name the same as the old version e.g. "Purchase Order Form"



  8. Go to "Purchase Order Forms" > Settings > Form Library Settings > Change New Button Order and Default Content Type
  9. Hide the old content type as you don't want new instances created (e.g. hide "PurchaseOrderForm_V1-00") and show the new version "Purchase Order Form". It should be selected as the default content type.
  10. Finished - old versions of your form will still open without error and appear as they used to, and the new versions will open with the updated code base and schema.

    Also See http://www.delphi-ts.com/blogs/lozzi/post/2009/07/08/Versioning-Your-Published-InfoPath-Forms.aspx which has similar info. I also confirmed that this works if your Forms reference common code Dlls - the assemblies required for the forms are also not blown away as you are not upgrading.