SharePoint hates default values in InfoPath forms
Learn how you can solve the 'infinite loop error' SharePoint displays for browser forms that contain too many fields on which default values have been set.
If an InfoPath form contains too many fields on which you have set default values, SharePoint may display the following error:
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.
A good example of when this error could occur is if you have set default values on fields that are in a repeating table and which repeatedly perform the same calculation on a column of fields.
Note: InfoPath Filler does not seem to have the same issue with default values.
To solve the problem, you must replace the default values with Set a field's value action rules – as much as you can. Formulas defined as default values generally run:
- When a form loads.
- When the formula for the default value is refreshed or recalculated.
So you can use Set a field's value action rules in the Form Load event of an InfoPath form to simulate the first type of default values. You can access and add rules to the Form Load event by clicking Data > Rules > Form Load.
The second type of default values can be challenging to replace sometimes. If this is the case, you must come up with creative ways to replace the default values with Set a field's value action rules. In most cases you should be able to replace the default values, but sometimes you may have to resort to tricks to get things done.
While it is quick and easy to define a formula as a default value on a field, if you intend to publish a form template to SharePoint, it might be best to always try to use Set a field's value action rules before considering using default values on form fields.
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.