How to avoid infinite loops on setting fields - InfoPath Dev
in

InfoPath Dev

How to avoid infinite loops on setting fields

Last post 03-14-2011 03:26 PM by ckili. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-14-2011 09:16 AM

    • ckili
    • Not Ranked
    • Joined on 02-15-2011
    • Posts 12

    How to avoid infinite loops on setting fields

    Hello, I have two fields, item ID and Description from an SQL DB. I put them in drop-down list boxes. When I choose Item Id, the Description should be set. When I choose Description, the Item ID should be set. If I put the rules, an error occurs: "An error occurred in the form's rules or code. The number of rule actions or the number of calls to the OnAfterChange event for a single update in the data exceeded the maximum limit. The rules or code may be causing an infinite loop. To prevent this, ensure that the rule action or event handler does not update the data which causes the same rule action or event handler to execute." I'm trying a solution with a checkbox (if checkbox1=false, checkbox1=true; actions;checkbox1=false), but any other suggestion is welcomed!
  • 03-14-2011 01:29 PM In reply to

    Re: How to avoid infinite loops on setting fields

    In the conditions for your rules, check to see if the other one is blank: Ex: In field A, condition: If B is blank, set B.  In field B, condition: If A is blank, set A.

    This will stop your loop from ocurring, since it has no way to occur.

  • 03-14-2011 03:26 PM In reply to

    • ckili
    • Not Ranked
    • Joined on 02-15-2011
    • Posts 12

    Re: How to avoid infinite loops on setting fields

    Thanks leoffneym, Yet, the user has the tendency of playing, and you'll end up with different ID's and descriptions. And in my (real) problem, I need to play with 3 drop-down lists!!! I came to understand that rules on a control run whenever the control changes, so by putting a check box field (default:false) and put a condition:if checkbox=false, then checkbox=true, do the actions, checkbox=false, then on the other control, when is changed, it'll find checkbox=true and won't run... In theory....
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.