Showing posts with label Infopath. Show all posts
Showing posts with label Infopath. Show all posts

Sunday, 2 December 2012

System.Security.SecurityException was unhandled by user code - InfoPath 2010

Problem:

Sometimes working with InfoPath , in my case its InfoPath - 2010, come across a problem of security exception mentioned below :

System.Security.SecurityException was unhandled by user code
Request for the permission of type 'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=14.0.0.0, Culture=neutral, PublicKeyToken=xxxxxx' failed

This exception arises when we are using some code snippet to communicate with SharePoint in any way. 

Plus would like to mention that when we use any "Manage Data Connection" , and preview our InfoPath form, it usually prompt a message :




Solution:

To solve this problem, you have to switch your InfoPath - 2010 form to Full Trust.
To do that, click "File" , then from menu choose "Info" and then "Form Options", and then uncheck "Automatically determine security level", by default its checked, and it will enable 3 radio buttons below this.
You have to choose "full trust", click OK. 

Now both the above mentioned warnings and exception should not occur.


Monday, 16 January 2012

Change events not working on browser - InfoPath Form

Problem
In infopath, you might face a problem that the change events for controls work on local system but when deployed to the server or run in browser, these change events might not work like change event for dropdown list, checked change event for Checkbox.

Solution
You just have to set an option in the properties of the control.
Right click on the control for which event is not working, click Control properties, probably the last option in the menu, and in the Properties windows, select "Browser forms" tab. You will find 3 options there,
  1. Never
  2. Always
  3. Only when necessary for correct rendering of the form
By default, the 3rd option is selected, you have to select the 2nd option i.e "Always".
You problem is solved :)

Thanks for you time.


Test Email without sending Email to User - C# / C-Sharp - DotNet

Sometimes we may want to test email functionality without sending email to actual user. Email will be saved locally so that we can verify ...