Submitting to document library in various sites - InfoPath Dev
in

InfoPath Dev

Submitting to document library in various sites

Last post 06-28-2010 06:07 AM by vervoorttom. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-28-2010 05:27 AM

    Submitting to document library in various sites

    Hi,

    I've created an administrator-approved browser form to enter project data in SharePoint. This form is used in multiple sites (all in the same site collection). All these sites are based on a template and contain one form library, so all form libraries have the same name but a different url. How can I configure the dataconnection so that when submitting the form, it is saved in the correct form library (the form library in the site where the user clicked 'new') ? In the new dataconnection wizard, I can only enter one document library url and it cannot be dynamic (via functions).

     A solution with custom code would be ok too, as long as property promotion/demotion would work.

     

     Regards,

     Tom

  • 06-28-2010 06:00 AM In reply to

    Re: Submitting to document library in various sites

    Hello Vervoorttom,

     Here is a code sample in C# on how to submit to a form library.


    FileSubmitConnection
    SubmitConn = (FileSubmitConnection)DataConnections["Main submit"];
    SubmitConn.Filename.SetStringValue(formName);
    SubmitConn.FolderUrl =
    "http://portal/sites/rh/formulaires/Training%20Approval/" + formName;
    SubmitConn.Execute();
    e.CancelableArgs.Cancel =
    false;

    In this code you modify the Data Connection that you created to submit your form and change the url where it will be submitted. Put this code in the submit event.

    You will need to include this dll as well.

    using Microsoft.SharePoint;

    Hope that helps

  • 06-28-2010 06:07 AM In reply to

    Re: Submitting to document library in various sites

    That doesn't seem to be very difficult. :-) Thank you ! I'll try this out tonight.

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