Data Connections Cause “The form has been closed” Error

The dreaded “Form is closed” error… something is wrong with your form, and there is very little information as to what it might be.  Or how to fix it.  This is an interesting one I came across today.  I have a simple InfoPath form with four data connections that connect to SharePoint lists on my site.  When the first page with data connections tries to load, I get the usual generic error message:

followed by the evil “The form has been closed.” error.  Ugh.

The event log had the following entry:

Event Type: Warning
Event Source: Office SharePoint Server
Event Category: Forms Services Runtime
Event ID: 5368
Date:  22/08/2008
Time:  4:04:38 PM
User:  N/A
Computer: <deleted>

Exception occurred during request processing. (User: <deleted>, Form Name: , IP: , Request: <deleted>, Form ID: , Type: XmlException, Exception Message: Unexpected end of file has occurred. The following elements are not closed: dfs:dataFields, dfs:myFields. Line 1, position 306.)

For more information, see Help and Support Center at

Turns out one of my SharePoint lists had an entry with a forward-slash (/) in it.  Looks like InfoPath might not be HTML-encoding/escaping/checking this text, so it killed the Xml and thus broke my form.  I fixed up the slash entry and the form loads just fine.  So beware the forward-slash!



6 Responses to “Data Connections Cause “The form has been closed” Error”

  1. raja Says:


    i am facing the same problem can you please help me on this,Please tell me how did you fix the forward slash entry. FYI: i am using a dataconnection to a sharepoint list(Secondary) and checking a name exists in the list.

    Please if you can replay send me ur suggestions to my mail id

    Thanks in advance.

  2. gavinmckay Says:

    Hi raja,

    I just edited the items in the list (using the browser, edit list item) and changed the forward slash to a minus sign “-” as this looked OK for my display.

    Let me know if this doesn’t work for you.


  3. raja Says:

    Hi gavin

    I dont have any forward slash in my file name. as i told you i am just using the sharepoint list to check if there is a item already with the name whcih is built in the form.

  4. gavinmckay Says:

    Hi Raja,

    No, I don’t mean the file name – I mean the individual items in the list. For example, if you have a list with countries:

    United Kingdom

    Then the “/” in the USA entry could cause this error. You may need to look at the items in the list itself to make sure they are OK.

    Does this help?

  5. Switching Views in browser causes obscure errors and form closures | keyongtech Says:

    […] my list data seemed to do the trick. Props also go to the following blog posts for helping me out…-closed-error/…ath-forms.aspx here’s how I found them […]

  6. Dennis Says:

    This fixed my issue. Great catch! Much appreciated.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: