Whistleblower Email - InfoPath Dev
in

InfoPath Dev

Whistleblower Email

Last post 10-03-2012 07:51 PM by Gennady Vanin (Геннадий Ванин, Новосибирск). 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-03-2012 07:19 AM

    • pollo
    • Not Ranked
    • Joined on 10-03-2012
    • Posts 1

    Whistleblower Email

    I've been put in charge of creating a form as a whistleblower program. I need to be able to upload it to Sharepoint and after some research I learned that Infopath 2010 can do it. However, this is my first time doing this and I have absollutely no experience in either Infopath or VSTA coding.

    Here's the document setup I'm using. I have the Submit button setup to use "Rules and Custom Code" 

     Here's what shows up in VSTA.

     Again, I've never messed with this and I can only assume that this is the section I need to edit :

    public void CTRL4_5_Clicked(object sender, ClickedEventArgs e)

    {

    // Write your code here.

    }

     I did some research and I was told to put in this code :

     public void SubmitForm_Clicked(object sender, ClickedEventArgs e)
           
    {
               
    // Run the main submit as System Account
               
    SPSecurity.RunWithElevatedPrivileges(delegate()
               
    {
                   
    this.Submit();
               
    });
           
    }

    However, when I did that I get a compiling code error when trying to preview the file. Any ideas, suggestions would be greatly appreciated.

  • 10-03-2012 07:51 PM In reply to

    pollo:

                SPSecurity.RunWithElevatedPrivileges(delegate()
               
    {
                   
    this.Submit();
               
    });
           
    }

    However, when I did that I get a compiling code error when trying to preview the file. Any ideas, suggestions would be greatly appreciated

     

    SPSecurity.RunWithElevatedPrivileges(delegate()

    is server-side code and Preview is run on client machine

    Also, it is not available for sand-boxed solutions andm thereafter, cannot be used in Sharepoint Online (Office 365).

    Then, it looks like you are trying to subvert Infopath security model which you hardly can achieve without breaking your neck, i.e. Infopath application.

    Why do you need it?
    Or, better, what are you trying to achieve (you described HOW but forget to tell WHAT?

     

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.