locked
How can I submit an Infopath Form in Infopath Code Behind? RRS feed

  • Question

  • Hi,

    Using Sharepoint 2007 Workflow and Infopath 2007 Form on VS2008: Windows 2003

    How can I submit an Infopath 2007 Form in Infopath Code Behind?

    Reason I ask is I have a copy form button which essentially makes ONE copy of the form to reuse. i.e. saves empty field copy of form. Problem is my users now want to specify how many copies they want - which I have to do in code.

    Help Appreciated.

    John.   


    Tuesday, August 2, 2011 8:34 AM

Answers

  • I use the following code snipet

    //Submit to sharepoint
            DataConnection submitConn = DataConnections["SharePoint Library Submit"];
    
            submitConn.Execute();
    

     

    In this "SharePoint Library Submit" is a the name of a normal data connection to submit to a SharePoitn library.
    • Marked as answer by John Guilbert Wednesday, August 3, 2011 8:27 AM
    Tuesday, August 2, 2011 2:38 PM

All replies

  • I have seen this.submit();

    But what about if I want to use a data connection????

    • Marked as answer by John Guilbert Tuesday, August 2, 2011 9:07 AM
    • Unmarked as answer by John Guilbert Tuesday, August 2, 2011 9:12 AM
    Tuesday, August 2, 2011 9:07 AM
  • I use the following code snipet

    //Submit to sharepoint
            DataConnection submitConn = DataConnections["SharePoint Library Submit"];
    
            submitConn.Execute();
    

     

    In this "SharePoint Library Submit" is a the name of a normal data connection to submit to a SharePoitn library.
    • Marked as answer by John Guilbert Wednesday, August 3, 2011 8:27 AM
    Tuesday, August 2, 2011 2:38 PM