Friday, February 6, 2015

Quick Fix For “There has been an error while loading the form”

I’m testing a custom SharePoint Designer 2010 activity this fine Sunday afternoon and I was unexpectedly hitting a “Critical Error” when trying to launch the workflow:

There has been an error while loading the form.
Click Start Over to load a new copy of the form.  If this error persists, contact the support team for the Web Site.
Click Close to exit this message.
Show error details


Of course, if you click the “Show error details” button all it does is show you a correlation ID:


* In my case, this turned out to be an Alternate Access Mappings problem.

* I looked at the log file in the 14 hive and saw that InfoPath was complaining about an AAM issue (since I was hitting Localhost instead of the server name).  I changed my URL and that solved it.
Ex :

* Here the problem in this case was with the URL. First I was giving the below URL:
http://win-pfcp2dgt8di/_layouts/15/FormServer.aspx?XsnLocation=http://win-pfcp2dgt8di/MyTestFormLib/Forms/template.xsn&SaveLocation=http%3A%2F%2Fwin-pfcp2dgt8di%2FMyTestFormLib&ClientInstalled=false&DefaultItemOpen=1

Then I gave the below URL and it is working now.

http://win-pfcp2dgt8di/_layouts/15/FormServer.aspx?XsnLocation=http://win-pfcp2dgt8di/MyTestFormLib/Forms/template.xsn&OpenIn=browser&SaveLocation=http://win-pfcp2dgt8di/MyTestFormLib
It does to show that with all the linkings of the various bits now in SP 2010, the thing you naturally this is a problem (SharePoint Designer workflow in my case) is actually totally unrelated to the core problem.

InfoPath 2010 – When creating a filename that breaks your submit

When using a new product a day never goes by when you don’t learn something new and today was no exception.  I’ve been working on 3 new forms and today I was making tweaks to a couple of the forms and after publishing one of them I ran into the below errors when trying to submit a new form to a form library.  The error messages that I was receiving  were really vague to for the actual problem.

InfoPath cannot submit the form.
An error occurred while the form was being submitted.
The form cannot be submitted to the following location: form library url
The site may be offline, read-only, or otherwise unavailable.
The thread is already in background processing mode.



* Then reviewed the changes that were made before it broke and couldn’t find anything wrong.  Started to look at the error messages again and when I scrolled over to the right to view full URL a light bulb turned on because

* I noticed something that a previous client had a problem with.  My filename ended with a . (period) and that’s a big no no with InfoPath forms.  The naming convention for the filename is “event name - company name” and for this instance the company name ended with a period.

* Once I removed the period from the end of company name everything worked like a charm.
* For my client we had to use a rule to search the filename for illegal characters before the form was submitted and replacing them with a _ (underscore) or just removing it all together.

The approach was used because we couldn’t rely on the users to remember not to add illegal characters to the end of the filename.