Submit one infopath form to 2 form libraries having different form templates - InfoPath Dev
in

InfoPath Dev

Submit one infopath form to 2 form libraries having different form templates

Last post 01-16-2009 08:29 AM by utkarsh2012. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-15-2009 08:36 AM

    Submit one infopath form to 2 form libraries having different form templates

     Hi

    I am trying to SUBMIT: FORM X to FORM X - FORM LIBRARY  and at the same time submit the same data to FORM Y - FORM LIBRARY by managed code in c#.

     

    FORM X and FORM Y do not have the same form templates,

    I need the data transferred but when I am creating two separate Data Connections one for submitting to FORM X and another to FORM Y on FORM X, everything is going fine ans data is submitted to both the form libraries,

    BUT the when I open a submitted form (.xml) on FORM Y, it opens up with the form template of FORM X.

     

    The problem is the data being submitted to the second form library is taking the template.xsn file of the 1st form library.

     

    I have to do it by managed code, this is the code im using:

                string xpath = "/my:myFields/my:field1";
                IXMLDOMNode field1 = thisXDocument.DOM.selectSingleNode(xpath);
                string oldValue = field1.text; // Read
                field1.text = "data1";     // Write


                string xpath1 = "/my:myFields/my:field2";
                IXMLDOMNode field2 = thisXDocument.DOM.selectSingleNode(xpath1);
                string oldValue1 = field2.text; // Read
                field2.text = "data2";     // Write



                DAVAdapter MainSubmit = (DAVAdapter)thisXDocument.DataAdapters["SharePointLibrary_Submit1"];
                MainSubmit.Submit();

     

    I know i am missing out some where...please help! :-)

     

      

  • 01-15-2009 09:01 PM In reply to

    Re: Submit one infopath form to 2 form libraries having different form templates

    Any one??

  • 01-16-2009 06:30 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Submit one infopath form to 2 form libraries having different form templates

    Hi,

     

    This issue is coming because:

    When you open the form from first library, “href” in that form is pointed to first library only. And you are submitting that same form to first and second libraries. So, both libraries forms are pointed to first library only.

     

    You need to change the href to second library while submitting the form to second library.

     

    To work with already submitted forms, just re-link the forms in second forms library.

     

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 01-16-2009 08:29 AM In reply to

    Re: Submit one infopath form to 2 form libraries having different form templates

     Hey Anuma, Thanks for the reply!

    Yea I get that the href is same for both the forms so its referencing the First Form whereas it should reference the Second Form.

    We are able to change the reference by downlaoding the xml by managed code and again uploading it. But, its a very very slow process if we talk about 1000+ forms. So i needed a way to directly submit the form without 1. Downlaoding the form, 2. Editing the form to correct href, 3. Uplaoding the form.

    Hope i am clear... :-)

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