Debug Rules Using a Break Rule
Written by
Gregory Scot Collins
Wednesday, 4 March 2009, 2:57 PM
This article has been tested to work with the following products and versions. No guarantee of compatibility, with or without modification, is offered for products or versions other than those listed.
IN THIS ARTICLE:
Debugging rules in InfoPath can be quite exasperating as InfoPath does not provide an easy way to identify issues. If you have multiple rules on a control and something is not working as expected, you can narrow down which rule is causing the issue by creating a Break rule.
A Break rule has no conditions and no actions—its only purpose is to break the flow so that following rules are not processed. A Break rule is temporary and is discarded after debugging is complete.
Create the Break rule
You create a Break rule with the following steps:
- Right-click the control with rules that need debugging and click Properties.
- In the control Properties dialog box, click Rules.
- In the Rules dialog box, select the first rule, and then click Add.
- Name the rule BREAK.
- Select the Stop Processing Rules When This Rule Finishes check box, as shown in Dialog 1, and then click OK.
Debug using the Break rule
If you selected the first rule then the Break rule was added as the second rule in the list. You can either begin debugging here, or if you know certain rules are working fine, you can move the Break rule down the list by selecting it and clicking Move Down.
To debug using the Break rule, preview or launch your form, and then perform the action that will cause your set of rules to be processed. InfoPath will stop processing the rules when it encounters your Break rule. If the issue does not reproduce, go back to the designer and edit your rules. Move the Break rule down the list by selecting it and clicking Move Down. Try reproducing the issue again. Continue moving the Break rule down the list until the issue reproduces. At this point you have found the issue rule—it's the one just above your Break rule. Now you can debug the actions for that rule.
When you have finished debugging, you simply remove the Break rule. You can use this technique any time you run into issues with rules that are not easily identified.
Copyright ©2009
Braintrove. All rights reserved. This material may not be copied, published, broadcast, rewritten
or redistributed. You may, however, use the techniques, along with any associated code and files in
your development. This material is provided "AS IS" without warranty of any kind. You accept full
responsibility and liability for any and all results associated with use of this material.

Stumble It!
Digg It!
del.icio.us




