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.

ADVERTISEMENTS

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:

  1. When a form loads.
  2. 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.

 


Related Posts

 

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. 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.

InfoPath 2013 Cookbook: 121 Codeless Recipes for Beginners

InfoPath 2013 Cookbook 2: 121 Codeless Recipes for SharePoint 2013

InfoPath 2010 Cookbook: 101 Codeless Recipes for Beginners

InfoPath 2010 Cookbook 2: 101 Codeless Recipes for SharePoint 2010

InfoPath 2010 Cookbook 3: 101 Code Recipes for C# Developers

InfoPath 2010 Cookbook 4: 101 Code Recipes for VB Developers

InfoPath 2010 Cookbook 5: Integrating InfoPath with Excel and Excel Services