Quick Tip: Finding "hidden errors" in an InfoPath form template

Filed under: InfoPath 2007

Learn how you can prevent errors from suddenly popping up in your InfoPath form by using the Logic Inspector to find unused business logic.

ADVERTISEMENTS

An InfoPath form template consists of two core parts:

  1. A Main data source.
  2. One or more Views.

View vs. Main data source

The Main data source is the heart of an InfoPath form template, while a View is a window into part of that heart.

By default, when you add a control from the Controls task pane to a View, InfoPath automatically creates a field for you in the Main data source of the form template.

On the other hand, if you delete a control from a View, InfoPath will not remove the corresponding field from the Main data source. The field will exist until you manually delete it yourself by going to the Data Source task pane.

This is an important fact to remember when you start getting validation errors popping up or other strange things happening in your form template. Such errors may be related to controls and corresponding business rules (data validation, default values, rules, and code) you thought you had deleted, but in fact, still exist in your InfoPath form template.

Golden Tip:

To permanently delete a field from an InfoPath form template, delete it from the Main data source.

You can prevent InfoPath from automatically creating fields in the Main data source of the form template by deselecting the Automatically create data source check box, which is available at the bottom of the Controls task pane.

How to find sources of errors in an InfoPath form template

A quick way to find out whether there are rules, data validation rules, calculated default values, or code present within an InfoPath form template is by using the Logic Inspector.

The Logic Inspector is especially handy if you have large and complex InfoPath forms with many controls and business logic.

It also helps you find unused fields and business rules, which you may have added at one point in time, but which are not required anymore in your InfoPath form template. It is important to remove such unused fields and business rules, since they might cause problems and/or interfere with the proper functioning of your InfoPath form later on.

You can access the Logic Inspector by going to the Tools menu and clicking the Logic Inspector menu item.

 


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