Rules stop working when fields are updated

A

aturner

My form includes fields that are filled in automatically, through rules,
based on selections in other controls. This works fine, until a selection is
changed -- the other fields should update automatically when a change is
made, but they don't. In other words, it seems that the rules only run at
initial selection.

The controls are:
Maintenance (checkbox)
Price (read-only text field)
Product (drop-down list)

When Maintenance is selected, the Price is filled in based on the Product
selection. But when the Product is changed, the Price does not update to
reflect the new Product.

Is the best approach to add an OnAfterChange event that clears the
Maintenance checkbox whenever the Product is changed? I'm not a programmer,
so I will need a script example. Or perhaps there's a problem with the rules?

Any help will be appreciated.
 
A

aturner

Yes, that worked -- thanks! However, now that I've added more rules, I get
the following error when filling out the form:

An error occurred in the form's code. The number of calls to the
OnAfterChange event for a single update in the data exceeded the maximum
limit.

Recommendations?
 
J

Josh Bertsch [MSFT]

InfoPath recognizes loops and stops them after 15 itereations (this, I
believe, is an IE limit). As such, if you have rule that has a calculation
that has a loop (a rule on a text box that has a rule that sets it value to
1 + itself). Or if you have > 15 rules that get fired after just 1 action
you will run into this.

--josh bertsch

aturner said:
Yes, that worked -- thanks! However, now that I've added more rules, I
get
the following error when filling out the form:

An error occurred in the form's code. The number of calls to the
OnAfterChange event for a single update in the data exceeded the maximum
limit.

Recommendations?

Greg Collins said:
Rules are based on the field the control is bound to changing values. If
you select or clear the check box, that has no relation to whether you
select a product. If you want both updates to change a field, you must
have rules on both fields. If the price should only be changed if the
check box is selected, you must account for that in your rules on both
controls.

I hope this helps.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



My form includes fields that are filled in automatically, through rules,
based on selections in other controls. This works fine, until a
selection is
changed -- the other fields should update automatically when a change is
made, but they don't. In other words, it seems that the rules only run
at
initial selection.

The controls are:
Maintenance (checkbox)
Price (read-only text field)
Product (drop-down list)

When Maintenance is selected, the Price is filled in based on the Product
selection. But when the Product is changed, the Price does not update to
reflect the new Product.

Is the best approach to add an OnAfterChange event that clears the
Maintenance checkbox whenever the Product is changed? I'm not a
programmer,
so I will need a script example. Or perhaps there's a problem with the
rules?

Any help will be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top