Insert - InfoPath Dev
in

InfoPath Dev

Insert

Last post 12-07-2011 08:41 AM by ErnestoM. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-06-2011 01:31 PM

    Insert

    I have a repeating table that is inside a repeating section.  I have a button that uses the qrules insert command to add a row to the repeating table.

    However, when a second instance of the repeating section is added, when I click the button, it inserts the row on the table inside the first section only. 

    My original insert command is:

     concat("Insert /parent=/my:Quote/my:Item_Detail/my:Bill_of_Material  /child=/my:group10  /count=", count(billcost))

    Based on some forum feedback, I tried:


    concat("Insert /parent=/my:Quote/my:Item_Detail[", count(preceding-sibling::Item_Detail) + 1, "]/my:Bill_of_Material /count=", count(billcost) /xpathsrc=/my:Quote/my:Item_Detail/my:Bill_of_Material/my:group10")

    but this renders an error:  The text is missing a closing quotation mark." But I am not sure waht is wrong with my syntax.

    Any help is appreciated.

     

  • 12-07-2011 07:39 AM In reply to

    Hello,

    The Insert command's default (and currently only) behavior is only to add children to the first node that matches the /parent XPath.  In qRules 3.4 (which is in beta right now), we've added the ability to add children to all of the nodes that match the /parent XPath, but typically, the desirable approach is to add just the right number of children to each specific location, instead of the same number to all of them.

     It looks like you forgot to resume the quoted part after your count(billcost) part.  This should a valid formula, though I can't say for sure that the logic is quite right:

    concat("Insert /parent=/my:Quote/my:Item_Detail[", count(preceding-sibling::Item_Detail) + 1, "]/my:Bill_of_Material /child=my:group10 /count=", count(billcost), " /xpathsrc=/my:Quote/my:Item_Detail/my:Bill_of_Material/my:group10")

     

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-07-2011 08:41 AM In reply to

    Hi Jason,

    I believed you purchased qRules last month. We'd be glad to send you qRules v3.4 once it's released since it will contain a fix for the Insert command.

    Feel free to contact us via support at qdabra dot com.

    Thank you.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


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