Data from Repeating Sections - InfoPath Dev
in

InfoPath Dev

Data from Repeating Sections

Last post 03-02-2009 09:25 PM by Rajitha. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-26-2009 03:29 PM

    Data from Repeating Sections

    Hello,

     I have two text boxes (Invoice Number and Invoice Amount) in a repeating section so that the user can add as many invoices as needed.  I would like to use the data entered into these fields to auto-populate Invoice Number and Invoice Amount text boxes in another view.  How can I take multiple rows from a repeating section to create multiple rows of the same data?

    Filed under:
  • 02-26-2009 07:25 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Data from Repeating Sections

    Hello,

    You have to write code to get the node list and populate those values to another view node values in button click event or any other event. Your code should be like this below,

    IXMLDOMNodeList nodeList = thisXDocument.DOM.selectNodes("XPath of your repeating node");

    IXMLDOMNodet copyParentNode = thisXDocument.DOM.selectNodes("XPath of your repeating node parent to be copy");

    foreach(IXMLDOMNode node in nodeList)

    {

    copyParentNode.appenChild(node);

    }

  • 02-27-2009 07:44 AM In reply to

    Re: Data from Repeating Sections

    Thank you for your response Shiva.  I appologize, but I am very inexperienced when it comes to coding.  I copied the code you provided and added information from my form.  However, I recieve the following error: 

    InfoPath cannot open the selected form because of an error in the form's code.

    The following error occurred:

    Expected ';'
    File:script.js
    Line:24
    IXMLDOMNodeList nodeList = thisXDocument.DOM.selectNodes("/my:myFields/my:MemoInvoice");

    The coding I have is as follows:

    {

    IXMLDOMNodeList nodeList = thisXDocument.DOM.selectNodes("/my:myFields/my:MemoInvoice");

    IXMLDOMNodet copyParentNode = thisXDocument.DOM.selectNodes("/my:myFields/my:OANumber");

    foreach(IXMLDOMNodenode in nodeList)

    copyParentNode.appenChild(node);

    }

    Are you able to tell if I am doing anything wrong?

  • 03-02-2009 09:25 PM In reply to

    Re: Data from Repeating Sections

    Hi,

    IXMLDOMNodet copyParentNode = thisXDocument.DOM.selectNodes("/my:myFields/my:OANumber");

    In above statement 'IXMLDOMNodet' is wrong. Replace with  'IXMLDOMNode'.

     

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