2
votes

I have some InfoPath 2010 forms with custom code that submits information to SharePoint 2010 form-enabled libraries. One of the forms has a date field, chosen by a picker and stored in a Date/Time column in the library. The form had been working fine for months, but one day it just started failing with the following error:

There has been an error while processing the form. 
Click OK to resume filling out the form. You may want to check 
your form data for errors. 

When I click "show error details", it shows error code 5337 and gives a correlation ID.

When I look up the error in the event log, the details are as follows:

Business logic failed due to an exception. (User: XXX\frank, Form 
Name: Miscellaneous Form, IP: , Request:
http://intranet//apps/_layouts/FormServer.aspx
XsnLocation=/FormServerTemplates/Miscellaneous  
Form.xsn&Source=/apps/SitePages/expenses.aspx&DefaultItemOpen=1, 
Form ID: urn:schemas-microsoft-com:office:infopath:
Miscellaneous-Form:-myXSD-2012-05-14T12-19-23, 
Type: FormatException, 
Exception Message: String was not recognized as a valid DateTime.)

I am at a complete loss to understand how this problem can have arisen. No aspect of the solution was touched between when it was working and when it stopped. The date format on the InfoPath form is the same as the date format in the SharePoint list column. The system locale and regional settings are consistent everywhere and have not been changed. The problem arose after a slew of Windows updates on the 20th of January, so I'm wondering if one of those might have caused the problem.

The next steps I plan to take are to rebuild and redeploy the form to see if that fixes the problems. However this is code I inherited and it's part of a larger solution, so I'm nervous about redeployment in case I break other things. That's why I wanted to ask here if anyone has come across this or a similar problem before and can to point out something obvious that I might have overlooked.

Thanks for taking the trouble to read this. Any advice would be very much appreciated.

1
Hmmm… InfoPath Forms Services sometimes exhibits peculiar problems… I'd try increasing the form's version (edit the form, save) and redeploying by completely retracting and removing the solution from the server and then adding and deploying again. Not the best piece of advice, I know.Ondrej Tucny

1 Answers

1
votes

I've faced some issues with InfoPath after Windows and/or SharePoint updates, so you should not rule out that as root cause of the problem. I would check for any known issues using the updates's name.

Regarding the DateTime format, is your custom code setting the DateTime value? If the answer is yes, make sure you are using the following format for the date.

infoPathField.SetValue(dateFieldItem.ToString("yyyy-MM-dd"));

One other thing, can you check the SharePoint LOGS and copy the exception stacktrace?