Accidentally Adding Code to an InfoPath Form; Deliberately Removing It

When working with buttons on a form, we often add rules.  You access the rules editor from the properties of the button.

When clicking around quickly, it’s easy to accidentally click on "Edit Form Code" instead of "Rules …".

The first time I did this, I canceled out of the code editor.  However, when I tried to publish the form a little while later, it required that I publish as an "Administrator-approved form template (advanced)".  I didn’t actually do any programming and I absolutely didn’t want to go through an unnecessary approval process.  I was in a bit of panic at the time due to time constraints.  To get past it, I simply restored a previous backup and continued.  I had recently seen some blog posts about people going into the form’s XML to tweak things and I was afraid I would have to do something similar.

Today, I did it again.  This time, I had a little more time on my hands and found that you can easily undo this.

Go to:

Tools -> Form Options -> Programming: "Remove Code"

It does not get much easier than that.

</end>

Technorati Tags: ,

2 thoughts on “Accidentally Adding Code to an InfoPath Form; Deliberately Removing It

  1. Chris
    Paul,
     
    I have run into this before and discovered the same button. Glad you went ahead and made it available to the community at large!
     
    Chris
    Reply
  2. jumpret

    Dear Paul,

    thanks for helping, indeed i had troubled with this stuff..
    and your post helped me a lot..

    thanks

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *