What is it that would cause no error message to be logged if the form fails to submit?
I have a form that has custom submit code written and at times fails on submit. It gives a correlation id which I give to my sharepoint server admin. Apparently nothing is getting written into the log file for that ID. After some google searching I could not find anyone else with a similar problem which leads me to beleive that how we handle exceptions is wrong. I don't know enough about coding with InfoPath to say for sure that it is done wrong but I am suspicous it is.
The catch block is where I think the problem is because of no error messages are shown.
catch (Exception ex)
{
e.CancelableArgs.Message = ("There was a problem submitting the form:\n\n" + ex.Message);
e.CancelableArgs.Cancel = true;
}
e is a SubmitEventArgs object that gets passed in. This is the last lines of code in this function so I don't know if it is supposed to be writing to the log or if that is handled by sharepoint itself if an event is cancelled. Because nothing is getting written to the log this would lead me to believe that this code is wrong. If it is can you either provide a link to example code that is correct or explain what needs to be done.
This is done with InfoPath 2007 and SharePoint 2010