Custom Code to open a URL resulted in: Business Logic failed due to an exception. Type: SecurityException error - InfoPath Dev
in

InfoPath Dev

Custom Code to open a URL resulted in: Business Logic failed due to an exception. Type: SecurityException error

Last post 07-16-2013 12:31 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-16-2013 11:27 AM

    Custom Code to open a URL resulted in: Business Logic failed due to an exception. Type: SecurityException error

    I am writing a simple custom code to a Button control in C#.  The code is supposed to open a URL in the same window.

    public void CTRL10_5_Clicked(object sender, ClickedEventArgs e)

    {

    string URL = "www.google.com";

    System.Diagnostics.Process.Start(URL);

    }

    Note: Typically, I would have a Hyperlink control, Howerver, clicking on a Hyperlink opens the URL in a new Window or Tab.  I have a process where a user would be asked to fill up to 10 web-enable InfoPath 2010 forms.  I need the code above in order for the user to switch from one form to another seamlessly.  I will be replacing 'www.google.com' with a URL that opens an InfoPath form in browser mode.  For now, I have ruled out creating a single InfoPath form with 10 views -- since each of the forms has data/SharePoint columns to support and its own unique workflows.

    I have set the form Security Level to domain.

    I have published it as an Admin-aproved form template; uploaded the template to InfoPath Form Services (SharePoint 2010), activated it to my site collection, applied the InfoPath Content Type to my form library.

    When I click on the button I get this error:

    Category: Runtime - Business Logic

    Message: Business logic failed due to an exception. (User: ******, Form Name: URLTest PL, IP: , Request: <<removed by me for security purposes>>, Type: SecurityException, Exception Message: Request failed.) 

     

    I also tried to set the Security Level to Full Trust.  After republishing the form when I click on the button, nothing happens.

     

    Any information or help will be greatly appreciated.

     

    P. 

     

  • 07-16-2013 11:31 AM In reply to

    Re: Custom Code to open a URL resulted in: Business Logic failed due to an exception. Type: SecurityException error

     I think in your browser form this code is going to open the URL on the server.

    Hilary Stoupa

  • 07-16-2013 12:24 PM In reply to

    Re: Custom Code to open a URL resulted in: Business Logic failed due to an exception. Type: SecurityException error

    Hi Hillary, thanks for replying.  I don't understand what you are saying. 

    Is there something wrong in my code?

  • 07-16-2013 12:31 PM In reply to

    Re: Custom Code to open a URL resulted in: Business Logic failed due to an exception. Type: SecurityException error

    Well - not really, but the code is going to run on the server. So, when you run the form in preview and click the button, Process.Start is starting the process on your machine. If the code runs on the server, what machine would you expect the process to start on? I'd think it would start on the server.... I don't know of an alternative for what you are trying to do, or I'd suggest it... I think you may be stuck with a single form with multiple views.

    Hilary Stoupa

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