How do I insert on repeating groups? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How do I insert on repeating groups?

Last post 09-05-2012 07:57 AM by Hilary Stoupa. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 08-26-2012 09:28 PM

    How do I insert on repeating groups?

    Hi I've tried this: Insert /parent=/my:myFields /child=my:Group1 /count=10 which creates 10 rows of my main group1 Then this Insert /parent=/my:myFields/my:Group1[1] /child=my:Group2 /count=2 which creates two under my first main group1 Insert /parent=/my:myFields/my:Group1[2] /child=my:Group2 /count=2 which creates two under my second main group1 BUT! Insert /parent=/my:myFields/my:Group1[3] /child=my:Group2 /count=2 won't create two under my third main group1 NOR would it create two under the remainder of the group1 Help please? REgards
  • 08-27-2012 05:44 AM In reply to

    Re: How do I insert on repeating groups?

    Hi,

    Could you explain more about your schema, or perhaps even attach a screenshot of the data source or the form itself? I'm having a hard time visualizing which are the repeating groups, whether all repeating groups have a parent container group, etc.

    Thanks!

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


  • 08-27-2012 06:24 AM In reply to

    Re: How do I insert on repeating groups?

    Hi MyFields Group1(repeating) Field1 Group2(repeating) Field2 Regards
  • 08-27-2012 08:15 AM In reply to

    Re: How do I insert on repeating groups?

    As a rule of thumb, I would suggest structuring your data source so that all repeating groups have their own exclusive non-repeating parent.  In your case it would be something like:

    myFields

    |- Group1Parent

       |- Group1 (repeating)

           |- Field1

           |- Group2Parent

              |-Group2 (repeating)

                 |-Field2

    When you want to use Insert on a specific nested repeating group, like in your case, you need to specify the xpathsrc parameter.  Please try this:

    Insert /parent=/my:myFields/my:Group1[1] /child=my:Group2 /count=2 /xpathsrc=/my:myFields/my:Group1/my:Group2

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-27-2012 02:19 PM In reply to

    Re: How do I insert on repeating groups?

    Excellent! the /xpathsrc fixed my problem! Thank you Jimmy!
  • 09-03-2012 08:36 PM In reply to

    Re: How do I insert on repeating groups?

    Hi Jimmy, sorry It only fixed my problem in Filler, not in Browser: This is the command that I have Insert /parent=/my:myFields/my:grpSupport/my:Support[2]/my:grpSupportCFH /child=my:CFH /count=2 /xpathsrc=/my:myFields/my:grpSupport/my:Support/my:grpSupportCFH/my:CFH In filler it works perfectly, but in Browser it failed with these errors and a Correlation ID: An error occurred in the form's code. The number of calls to the Changed event for a single update in the data exceeded the maximum limit. and Default values, rules or code may be running in an infinite loop. To prevent this, ensure that the default value, rule action or event handler does not update the data which causes the same rule action or event handler to execute.
  • 09-04-2012 04:29 AM In reply to

    Re: How do I insert on repeating groups?

    Sounds like it's exactly what the error suggests - that the insert is causing a rule or default value to run repeatedly in a loop.  It's impossible to tell you how to fix this without seeing your form.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-04-2012 02:05 PM In reply to

    Re: How do I insert on repeating groups?

    Why would it work 100% in Filler but not in Browser?
  • 09-04-2012 02:08 PM In reply to

    Re: How do I insert on repeating groups?

    Do you have any attributes in your repeating group? In Browser, I've had attributes trigger rules on the parent group. Very Icky.

    Hilary Stoupa

  • 09-04-2012 02:20 PM In reply to

    Re: How do I insert on repeating groups?

    No attributes anywhere. The insert rule is on the parent though.
  • 09-04-2012 02:27 PM In reply to

    Re: How do I insert on repeating groups?

    What I've done when I've had an issue like this (works in filler, looping error in browser) I try to find a way to set a condition on the rule that will prevent bubbling - so, for example, maybe the rule only runs if a particular field is blank in the inserted group... sometimes I use a helper field that I set to a specific value and use it to try to prevent a rule for executing more often than it should. You may want to set a field's value to its own value concatenated with whatever the qRules Command node has been set to, so you can see if something is causing a command to be executed multiple times.

    You may want to temporarily disable any rules on any fields inside the group to help you start tracking down where the issue is occurring....

    Hilary Stoupa

  • 09-04-2012 02:37 PM In reply to

    Re: How do I insert on repeating groups?

    I have a delete and then the insert. The delete executes 100% (tested this with insert disabled). I'v set a rule condition on the insert which to test that the repeating group does not exist. Again in filler this works and in browser the second instance of the repeating parent group fails.
  • 09-04-2012 02:50 PM In reply to

    Re: How do I insert on repeating groups?

    Yes, I understand that this works in filler and not in browser.

    Is the failure the looping error? Or something else?

    Hilary Stoupa

  • 09-04-2012 03:43 PM In reply to

    Re: How do I insert on repeating groups?

    I confirmed the logic of the rule in filler. I've changed the count to 1 for all the repeating groups and still get this error: An error occurred in the form's code. The number of calls to the Changed event for a single update in the data exceeded the maximum limit. I then changed the count = 2 and this is the error: An error occurred in the form's code. The number of calls to the Changed event for a single update in the data exceeded the maximum limit. Default values, rules or code may be running in an infinite loop. To prevent this, ensure that the default value, rule action or event handler does not update the data which causes the same rule action or event handler to execute.
  • 09-04-2012 04:12 PM In reply to

    Re: How do I insert on repeating groups?

    Feel free to attach the form to a reply or send it to me if you'd like me to take a quick look.

    Hilary Stoupa

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