Problem with administrator approved form - InfoPath Dev
in

InfoPath Dev

Problem with administrator approved form

Last post 06-06-2013 07:56 AM by Turtle. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 05-04-2010 09:33 AM

    Problem with administrator approved form

    I have a problem that I have been struggling with for two weeks. I have an Infopath browser enabled form published to a Sharepoint Form Library that should be accessed anonymously. The form uses custom C# code, so it is published as an Administrator approved form, and activated to the site collection. I have enabled anonymous access from Central Administration and to the library where the form is published (by changing the "DOCLIB" to "LIST"......). So now I can access the Forms library as anonymous user but when I try to open the form i get an error message: "Retrieval of the form template from the following location is not authorized". On the other hand if I am logged on as a user, I can open the form without problems, which means that the code is fine. Also, when I publish the form without the custom code, I can open it anonymously. Does anyone know what's causing this problem? Any help would be appreciated. Thanks
  • 05-05-2010 12:00 AM In reply to

    Re: Problem with administrator approved form

    when u publish a code less form, it is published to a particular doc lib and the template resides in the doc lib itself, but when u publish a template having managed code the template is saved at

    http://your site collection/FormServerTemplates/yourtemplate.xsn

    so that might be causing the problem, the anonymous users wont be havign access to this location

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 05-05-2010 06:39 AM In reply to

    Re: Problem with administrator approved form

    Hi Qazi,

    Thank you very much for your quick response. I can now open my form as anonymous user.

    But I have another problem. I am using this code for submitting the form:

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

    When I click the Submit button (in both cases: anonymously and as authenticated user) I get an error message:

    There has been a critical error while processing the form.

    Click Start Over to load a new copy of the form. If this error persists, contact the support team for the Web site.

    Click Close to exit this message.

    When instead of submitting code, I use simple Submit using the Main Data Connection, I can submit the form as authenticated user, but not anonymously.

    What can be the problem here?

    Thanks in advance.

    Boris

  • 05-05-2010 07:02 AM In reply to

    Re: Problem with administrator approved form

    include this statement in your submit procedure 

    e.CancelableArgs.Cancel = false;

     

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 05-05-2010 07:47 AM In reply to

    Re: Problem with administrator approved form

    I tried it, but it doesn't work. I get the same error message.

    Maybe there is a problem with my submit code:

            public void FormEvents_Submit(object sender, SubmitEventArgs e)
            {
                SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    this.Submit();
                });
                e.CancelableArgs.Cancel = false;
            }

     

    So can you recomend me another way to submit the form anonymously?

    Thanks

  • 06-06-2013 06:43 AM In reply to

    • Turtle
    • Not Ranked
    • Joined on 06-06-2013
    • Posts 2

    Re: Problem with administrator approved form

    I'm having this same problem, did you ever find a solution?
  • 06-06-2013 07:21 AM In reply to

    Re: Problem with administrator approved form

    Hello Turtle, I did find I solution for this problem, however it is for Microsoft SharePoint Server 2010 and the form is designed in InfoPath 2010. I use a simple button for submission of the form with the following code: public void CTRL132_5_Clicked(object sender, ClickedEventArgs e) { //some rules before submission SPSecurity.RunWithElevatedPrivileges(delegate() { this.Submit(); }); } This code will submit the form using the system account in the specified form library (no need for enabling anonymous access in the library or changing the "DOCLIB" to "LIST"......). However you will need to enable Anonymous Access from SharePoint Central Administration and allow access for anonymous users in the Form Templates Library, where administrator approved forms are stored. I hope this helps! Cheers!
  • 06-06-2013 07:56 AM In reply to

    • Turtle
    • Not Ranked
    • Joined on 06-06-2013
    • Posts 2

    Re: Problem with administrator approved form

    Thanks for the quick feedback. This is actually the exact code I'm using. The only difference being I am using InfoPath 2013 but still on SP Server 2010. I have other forms in the Form Templates Library that are functioning properly with anonymous access, but those were all published from InfoPath 2010. I wonder if using the newer version of InfoPath is where I am running into problems. I will contact the administrators and find out if they know what is causing this error. Thanks again!
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.