Hi all.
I have a InfoPath2007 form that gets SharepointPortal2007 data from a Library (Project Documents), puts it in av table and submits the form back to another Sharepoint Library (Forms).
When fetching the project documents I use a Sharepoint XML view that filters the documents: list only documents with field "Transmitt" = TRUE.
When the InfoPath form is submitted I want to set the field value of "Transmitt" in Sharepoint library to FASLE.
First approach: add a button in my form and try to connect to the Sharepoint library where the field I want to update is (if I get this to work I believe I can update the field values):
using System;
using Microsoft.SharePoint;
namespace Transmit_log_ver2
{
public partial class FormCode
{
public void Test()
{
SPSite mySite = new SPSite("http://sensets02/documentcontrol");
}
public void CTRL404_6_Clicked(object sender, ClickedEventArgs e)
{
Test();
}
}
}
Get an error:
Request for the permission of type 'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Assembly asm, SecurityAction action)
at Transmit_log_ver2.FormCode.Test()
at Transmit_log_ver2.FormCode.CTRL404_6_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)
Any suggestions on this approach or are there better/more elegant ways to do this?
Regards, Tom Gullberg - Norway