Debugging the InfoPath "this form has been closed" error

I recently ran into an issue with a browser-only InfoPath 2010 form published to a SharePoint 2010 form library where the users would receive seemingly random “this form has been closed” errors after they closed the form. The data was submitted to the library so there was no data loss. It was entirely a user experience thing since the error page is not user friendly and leaves the user with nowhere to go. 

I had seen this error before when the form was launched with a “Source” parameter specified after the XML file name. If this parameter exists and points to an invalid URL, you can see the error. However, in my case, it was happening even when the user was just clicking on the XML filename in the library (thus no parameters). So much for that theory. 

NOTE: All the “close form” actions were done with Rules - I had no code in the form (Domain level security) and I wasn’t using the default ribbon. 

Several internet searches suggested a few other things that I tried and didn’t work: 

  • If the form is closed with an Action rule, make sure the “Don’t run remaining rules if the condition of this rule is met” checkbox is checked at the end of the rule
  • In the Submit options, click on the “Advanced>>” button and check the value of the “After submit” field - this should be “Close the form”
  • Try republishing the form to a new form library - this didn’t have any effect 
  • I cut out all the data connections (leaving only the Submit) and extra views - still got the error 
  • Go to the Form options under “Versioning” and manually increase the “Version number” 

So I called Microsoft and they found the solution. Normally when you copy and paste a control, the new control is assigned a new ID number (look at the Control Properties under the “General” tab to see this). This insures that each button control on the form has a unique ID. Well, at some point during development, two of my buttons were assigned the same ID. Believe it or not, this is what was causing my “this form has been closed” errors. I simply assigned unique ID values to the duplicate controls, republished the form and the error went away. Problem solved! 

Hopefully this will help others experiencing the same issue.

Originally posted on the Project Leadership blog at http://www.projectleadership.net/blogs_details.php?id=2622 - the original post is no longer available.


My Picks for the 2012 Oscar Winners

Best Picture: The Artist
Best Director: Michel Hazanavicius (although Martin Scorsese has a very good shot)
Best Actor: Jean Dujardin
Best Actress: Viola Davis
Best Supporting Actor: Christopher Plummer (Max Von Sydow has a very good shot too)
Best Supporting Actress: Octavia Spencer
Best Animated Feature: Rango

File Share vs. SharePoint

Documents, documents everywhere. Businesses thrive on documents to store and communicate content. Where would we be without Microsoft Office? 

However, if you are not using a document management system (like SharePoint or OneDrive) , you aren’t storing and sharing these documents effectively. How many times have you wished you could quickly search the large file share at your company? Accidentally edited an older version of a document you thought was current? Had to remove old emails from your Inbox because you are running out of space with emails containing attachments? 

Let’s compare some of the advantages of storing documents on a file share vs. SharePoint (most of this applies to OneDrive as well). 

Traditional Method - File Shares / Local Storage: 

  • Files are emailed and/or stored on local or shared drives – Users must be also typically by on the network to access them
  • No version control and files can be overridden on shared drives with no auditing or history 
  • No “single source” of the truth 
  • Multiple people have multiple copies 
  • No way to search shared drives efficiently 
  • No metadata tied to the document (beyond basic Office information, like Title and Description) – i.e. no information about the content other than what’s in the document 
  • No alerts when content is changed 

SharePoint/OneDrive Method - Using a collaborative, document management system: 

  • Files are stored in smart, collaborative location with check-in/check-out, version history and auditing – “one version” of the truth 
  • All content can be accessed anywhere you have access to a web browser 
  • Metadata can be specified and tied to the document 
  • All content can be found via Search, including document contents and metadata Users simply email a link to the document – no “multiple copies” problem 
  • Users can be alerted when content changes 
  • Files can be opened and saved directly from Microsoft Office (2007 and newer) 

As you can see, keeping documents in SharePoint provides a clear advantage over the traditional use of file shares. Plus, SharePoint can be used for lots of other content, business intelligence, application development, business process automation, etc. 

A few tips: 

Careful planning is essential - mapping out the kinds of documents and the properties of those documents, and how SharePoint features like dynamic metadata driven navigation, document routing and document sets will impact and enhance the user experience 

  • Carefully planning your site architecture 
  • Understanding your desktop infrastructure - current versions of Windows, Office and web browsers are critical for a smooth user experience 
  • The companies that fail are the ones that treat SharePoint just as if it is another file share - no planning, just build it and go. 

Originally posted on the Project Leadership blog at http://www.projectleadership.net/blogs_details.php?id=2302 - the original post is no longer available. 

NOTE: This was the most popular post I created when I was at PLA. I have since used this content in many presentations. I have updated a bit since the original post, mostly version tweaks since this applies to all versions of SharePoint and referencing OneDrive.