I Just Can't Keep the Rules! - Greg Collins
in

InfoPath Dev

This Blog

Syndication

Greg Collins

I Just Can't Keep the Rules!

STATUS: Potentially fixed in InfoPath 2003 SP2.

DESCRIPTION:
I uncovered this bug on 2004-02-17 and reported it to my Microsoft contacts. It was at that point unknown to Microsoft.

The rules that you defined actually remain in the manifest. The bug is that the xsf:domEventHandlers block goes *POOF*! One way for this to happen is if you open the manifest.xsf file in the Visual Studio editor after rules have been created. But there are others.

Since the xsf:ruleSets block is still in the manifest, you could potentially attempt to establish stub rules for your controls and then manually reattach the domEventHandler to the correct ruleSet. But this may be more work than is worth the effort!

Having said all this, it can still be be very annoying and very problematic to have your rules disappear. But there are a couple of things that I do, in the mean time, to avoid getting hit by this problem. You may find them useful too:

  1. Keep a back up copy of your manifest each time you change rules, just in case this does happen.
  2. Whenever you publish, always shut down InfoPath and either close your solution, or shut down Visual Studio.
  3. Any time you modify a solution file other than FormCode.xx within Visual Studio, always shut down InfoPath and either close your solution, or shut down Visual Studio.

WORKAROUNDS:
One workaround is to replace rules with code in the OnAfterChange event. But this may not always be preferred.

I know it's a pain and inconvenient. And unfortunately you are one of the few of us who do the kinds of things that cause this. Just be patient and play by the rules I outlined above and you should be good to avoid it.

©2004 Greg Collins. All rights reserved. Licensed to Autonomy Systems, LLC for display on InfoPathDev.com.

Comments

No Comments
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.