Change Sharepoint Doc Library field values when submitting form to a Form Library - InfoPath Dev
in

InfoPath Dev

Change Sharepoint Doc Library field values when submitting form to a Form Library

Last post 05-14-2007 05:53 AM by pluto007. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-11-2007 03:05 AM

    • pluto007
    • Not Ranked
      Male
    • Joined on 03-16-2007
    • Norway
    • Posts 4

    Change Sharepoint Doc Library field values when submitting form to a Form Library

    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

    Tom Gullberg
    Norway
  • 05-11-2007 03:56 AM In reply to

    • ahardin
    • Top 200 Contributor
    • Joined on 02-13-2006
    • United Kingdom
    • Posts 55

    Re: Change Sharepoint Doc Library field values when submitting form to a Form Library

    Hi

    Where programmatically is the Transmitt field on SahrePoint or on Infopath?

    I'm from WALES
    [email protected]
  • 05-14-2007 05:53 AM In reply to

    • pluto007
    • Not Ranked
      Male
    • Joined on 03-16-2007
    • Norway
    • Posts 4

    Re: Change Sharepoint Doc Library field values when submitting form to a Form Library

    Hi

    The Transmitt field is defined as a column in a Sharepoint Document Library. I use this field to select documents to show in my form's Repeating Table and need to change the value (true/false) after the form is submitted to a Sharepoint Forms Library (to "clear" selections in this library field automatically for the users).

    Hope this was clearer - please ask for more info if necessary...

    Thanks,

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