Hi Team,
I am creating an infopath form using infopath designer.I am writing custom code in Visual Studio Tools for Applications(VSTA) IDE.
Added microsoft.sharepoint.dll to use sharepoint object model.
I placed the button on infopath form, and written some sample code to change the title of the list.
After build and deploying the code, tried to click on the button but I got the error message.
Below is the error message:
An unhandled exception has occurred in the form's code.
System.Security.SecurityException
Request for the permission of type 'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed.
at Form4.FormCode.btnsave_Clicked(Object sender, ClickedEventArgs e)
at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
Can you please provide me some sample codes to work sharepoint object model in VSTA for infopathforms.
Help is appreciated,
Krishna
Krishnasandeep