First, Do No Harm.... - Hilary Stoupa

InfoPath Dev

Hilary Stoupa

First, Do No Harm....

... to existing xml files. We've all had to make modifications to production forms, and some of us have failed to test the form with existing xml files until after we've redeployed our changes. I stand among the guilty. I think I thought if I clicked Preview often enough, and entered some likely looking dummy data, all would be well. And I'd find myself rolling back to a previous version of the form because *something* didn't work as anticipated when I opened the existing xml with the new template.

InfoPath has a feature that can protect us from these little mishaps--it will let you preview your form with an existing xml file. In InfoPath 2003, under File/Preview you can select With Data File and in InfoPath 2007 you can go to Tools/Form Options/Preview and enter a path to the data file you wish to preview with:
Preview tab

What kinds of mishaps will this save you from? Well, imagine you have added a new field to your form. Perhaps you have some conditional formatting that was based on the value of a different field, and you've changed it to use the new field....what value will your old xml have in that field? Did you remember to set your form to upgrade exsisting xml files? (Under Versioning in the screenshot above, just in case you forgot....) Maybe you changed an open rule, not realizing it did something vital -- all of these things can be hard to catch when you are previewing a new blank form each time.

So preview without data during design, but also take the time to preview with data -- production quality, if you have it. When you go to deploy your changes, you won't have any surprises....and unlike, say, birthday cake, this is a *good* thing in the form design world.

EDIT: One thing I forgot to warn you about. If you leave a file location in this box and then delete the XML -- guess what? Your form won't preview. In InfoPath 2007, you get a warning dialog with NO info:
Preview warning

This is very helpful, don't you think? You can open the form. But you can't preview the form. After you get done bashing your head against the desk, you can go clear the file path out of the Preview settings.

But with InfoPath 2010, we get a slightly better error:
Preview error

Not a good error. But a better error.

The moral is: remove the path to your preview XML prior to saving and closing your form. Future you will thank present you!


No Comments

About Hilary Stoupa

I wandered into development after working as a business process analyst for a global manufacturing company. I create InfoPath solutions for our clients as well as work as a developer on company tools that extend InfoPath. I've also been instrumental in creating the InfoPath Master Class training provided by Qdabra.

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