Infopath: Form Load Event not firing. - InfoPath Dev
in

InfoPath Dev

Infopath: Form Load Event not firing.

Last post 10-07-2005 01:45 PM by Matt Faus. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-07-2005 09:47 AM

    Infopath: Form Load Event not firing.

    Hello,

    I have an infopath form written in c# .net. The form compiles sucessfully on my machine, however when published to sharepoint an exception occurs. I know there is is an exception becuase I am using try, catch and finally ie:
    try {
    have custom code here


    }
    catch (Exception ex)
    {

    field1.text = "test";

    }
    finally
    {
    }
    and I am seeing the field1 set to test when the forms runs on Sharepoint. Do you guys have any idea how I would catch the exception on Sharepoint. I chcked the event viewer and did not see anything. Your help is greatly appreciated!
    Cheers!

    VidetteP
  • 10-07-2005 10:42 AM In reply to

    Re: Infopath: Form Load Event not firing.

    Why don't you use methods and properties associated with the Exception variable to determine exactly what the error is? Just because your program compiles correctly, doesn't mean that there will be no runtime errors. Determining the error thrown will be the first step towards correcting your code.

    I'm not familiar with syntax or structure of C#, but from my experience with other languages you could try something like this:

    catch(Exception ex)
    {
    field1.text = ex.errorDescription();
    }
    You would have to check your C# documentation on the Exception object to determine how to use it better, but you are throwing away a lot of valuable information by not using it.

    ---------------
    Matt Faus
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 10-07-2005 11:43 AM In reply to

    Re: Infopath: Form Load Event not firing.

    Hello Matt,
    Thanks for your help.
    I can now catch my error.

    The error I am getting is:

    Request for the permission of type System.Security.Permissions.EnvironmentPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

    Any idea what that means? In my project code I am uisng
    string dUser = System.Environment.UserName; as I am trying to get teh user login of the user on teh form.
    Again thanks a mill!!
    -Vidette

    VidetteP
  • 10-07-2005 01:45 PM In reply to

    Re: Infopath: Form Load Event not firing.

    No problem. Sounds like some kind of permission error with your form interacting with the server. You might have to deploy a Full Trust solution, or use a web service. As I am not familiar with Sharepoint at all, someone else will have to help you from here. Good luck!

    ---------------
    Matt Faus
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.