An InfoPath form template consists of two core parts:
- A Main data source.
- 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.

Comments to this post were closed 30 days after it was published.