Moving / Copying InfoPath Rules
By Mike G (6 posts -- read other by posts Mike G)
One difficulty of working with InfoPath is that if you have a button that has a rule with many actions and you would like to have some other button (or other control) execute those same actions, there is no way to simply copy the actions from one to the other. At least, not with the GUI…
Assuming you have a rule that has several actions similar to the following:

The goal is to get those actions moved to another rule that’s being processed by another control, such as a different button.
1. If the second button doesn’t have a rule at all, create one with a bogus action just to have a placeholder.
2. Take note of the IDs of both buttons (in the properties window for each button).
3. File menu –> save as source files (If you have’t done this before, you may want to check out this).
4. Find the manifest.xsf file, and open it with notepad.
5. In the manifest file, find the name of the first button. You should find XML that looks something like:
<xsf:button name=”Button1″>
<xsf:ruleSetAction ruleSet=”ruleSet_1″></xsf:ruleSetAction>
</xsf:button>
6. What you need to know is the name of the ruleset, so copy that and do another search for it. Further down in the manifest file, you should find something similar to:
<xsf:ruleSet name=”ruleSet_1″>
<xsf:rule caption=”Rule 1″ isEnabled=”yes”>
<xsf:assignmentAction targetField=…
<xsf:assignmentAction targetField=…
<xsf:switchViewAction view=…
<xsf:dialogBoxMessageAction>...
</xsf:rule>
</xsf:ruleSet>
7. So, simply copy the actions into the rule of the other ruleset that the other button is using.
8. Of course, if you make a mistake, the form won’t open, so paste carefully. :)
Related Posts:
Filed Under InfoPath |











