Trying to insert node: failed to insert the child node - InfoPath Dev
in

InfoPath Dev

Trying to insert node: failed to insert the child node

Last post 02-09-2011 05:36 AM by kbailey. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 02-08-2011 08:39 AM

    Trying to insert node: failed to insert the child node

    Greetings, all. First, please accept my apologies for my ignorance - I'm still getting my feet wet with qRules and Xpath. I am trying to insert rows of data into a repeating node. Here is the pertinent section of my main data source:

    -meetingAgenda

      -attendees

          -attendee (repeating)

              idNumber

              -attendeeInfo

                   Last_Name

                   First_Name

                   E-mail_Address

     Here is my insert statement:

    concat("Insert /parent=/my:meetingAgenda /xpathsrc=/my:meetingAgenda/my:attendees/my:attendee /count=", Count)

     I tried first doing this using the 'child' option (using /child=my:attendee) but got the 'failed to insert the child node' error, then I found Jimmy's post where he suggested using xpathsrc, but that throws the same error. Can anyone tell me what I am doing wrong?

    Thanks,

    Kevin

     UPDATE: If I use this: concat("Insert /parent=/my:meetingAgenda/my:attendees /child=my:attendee /count=", Count)  I get the error "failed to select the parent node"

  • 02-08-2011 08:51 AM In reply to

    Re: Trying to insert node: failed to insert the child node

    Hello,

     Can you attach a screenshot of your main data source?  You can use the Options tab when you reply to attach a file.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-08-2011 09:37 AM In reply to

    Re: Trying to insert node: failed to insert the child node

    Thanks for your reply. Screenshot attached.


  • 02-08-2011 09:43 AM In reply to

    Re: Trying to insert node: failed to insert the child node

    Thanks for the screenshot.  The command you pasted after UPDATE in the last line of your post does look correct.  Can you right-click the attendee node, select Copy XPath, and paste the value somewhere, to make sure that my: is the prefix you need to be using.  Also, is this in your main data source, or a secondary source?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-08-2011 10:00 AM In reply to

    Re: Trying to insert node: failed to insert the child node

    This is my main data source. Here is the xpath:

     /my:meetingAgenda/my:attendees/my:attendee

    Thanks again for any help you can give!

    Kevin

  • 02-08-2011 10:17 AM In reply to

    Re: Trying to insert node: failed to insert the child node

    Could you e-mail the form to Support at Qdabra Dot Com, so we could have a look at it directly?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-08-2011 10:21 AM In reply to

    Re: Trying to insert node: failed to insert the child node

    Very strange. I just designed a form with a schema similar to yours, and tried the command:

    Insert /parent=/my:meetingAgenda/my:attendees /child=my:attendee /count=2

    This worked fine. I also tried the command with concat(). I'm attaching a screenshot of the schema I created to test your scenario.

    Anyway, please send the form, as Jimmy says. The command should work but there may be an issue we're not seeing yet. Thanks.


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


  • 02-08-2011 10:25 AM In reply to

    Re: Trying to insert node: failed to insert the child node

    Thanks for your efforts on my behalf - I have sent the form via email.

     Kevin

  • 02-08-2011 01:11 PM In reply to

    Re: Trying to insert node: failed to insert the child node

    Thanks for sending your template, Kevin. The issue is that there's a preceding rule that calls the Delete qRules command to delete the attendees parent node. So then the Insert rule fails because the parent node doesn't exist anymore.

    What you'd want to do is change your Delete rule to point to the attendee child repeating group instead, so the command would be: Delete /xpath=/my:meetingAgenda/my:attendees/my:attendee

    Please let us know if the issue still persists.

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

  • 02-09-2011 05:36 AM In reply to

    Re: Trying to insert node: failed to insert the child node

    thank you for your follow up! that fixed the problem - thanks again for sticking with me on this one.

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