Problems using SharePoint objects in loading event - InfoPath Dev
in

InfoPath Dev

Problems using SharePoint objects in loading event

Last post 03-11-2011 11:23 AM by ferrx. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-11-2011 07:17 AM

    • ferrx
    • Not Ranked
    • Joined on 03-10-2011
    • Posts 16

    Problems using SharePoint objects in loading event

    I am getting the "form has closed" error whenever I add any SharePoint code at all to my LoadingEventHandler for my InfoPath form.  I have been able to do non-SP stuff such as modify the value of a field, but as soon as I add in code like:

    SPSite site = SPContext.Current.Site;

    or

    using(SPSite siteCollection = new SPSite("...url"))
    {
    }

    Once code like that is added, I get that "form has closed" error upon opening the form.  Am I missing something, a dll reference or something?  Should this work?

  • 03-11-2011 11:23 AM In reply to

    • ferrx
    • Not Ranked
    • Joined on 03-10-2011
    • Posts 16

    Re: Problems using SharePoint objects in loading event

    I looks like I just needed to set the trust level to Full Trust to get it to execute SP code.

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.