Exceptions not propogated up during FormLoad

S

Scott Hanslip

In the current project that I am working on, we are developing a large number
of InfoPath forms using the Visual Studio toolkit that are integrated with
Sharepoint and load default user information from Active Directory. We have a
web service providing us information from AD and everything is working just
fine. But, we came across an issue this morning regarding exception handling
in the Form Load event in the FormCode.cs.

In our Load event we are populating a number of forms for the current user
and their manager using calls to AD. This is working fine, but today one of
the developers coded one of the calls in a way that caused an error (that's
been fixed), but it did bring forward an issue regarding exceptions in the
Load event. It appears from our testing that if an exception is raised from
within the Form Load and it is not handled by custom code, Infopath appears
to catch the error and not display it. The code itself stops at the point of
the error, but no message is brought forward to the user and the form
continues to load as if nothing has happened.

We tried running the exact same code behind a button click, and it caused an
error exactly as we had expected - which has lead us to believe their might
be just an issue within the Form Load event itself.

In order to re-create this, just try throwing an exception right in the Form
Load code. No error message will appear.

We have gotten around this by adding our own custom exception handling in
the Form Load event with a Try-Catch, and that seems to fix the error.

Just curious - has anyone else ever seen this issue before?

(Note: We are using InfoPath 2003 SP1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top