Posted on 15th November 20114 Responses
How to: Remove code from an InfoPath form to allow it to be filled in on the browser

quickTip1

Sometimes, working with InfoPath can be a real pain. One of these times is when you accidentally hit the “Edit code” option. Even if you completely cancel out of the new programming window, you will soon realise that, if you want to publish your form on a SharePoint server to have it filled in on the browser, you won’t be able to.

The form will only be available to those who have the client installed.

In fact, if you do publish the form on a SharePoint server, you will face the following error message:

The form template has been published to the server but it can only be opened in InfoPath Filler.The sandboxed solution could not be activated.The custom code in the form cannot be run.
This functionality may be deactivated on the server.”

I came across this helpful post by Paul Galvin that explains exactly what you have to do in order to get rid of the custom code so that you can re-enable the form to be filled in on the browser. However, it is probably referring to the older version of InfoPath.

If you’re working with InfoPath 2010 and you want to remove your custom code from the form in order to be able to publish it on a SharePoint server and allow for browser editing, you need to do the following:

Go to the developer tab, click on Language and in the dialogue box that opens up, select the “Programming” category on the left hand side list and then, click on the “Remove Code” button on the right hand side options.

Comments
comment by Brandon Fletcher
Posted on January 26, 2012 at 19:38

@MGR,
I spun my wheels for days trying to resolve this issue and was as simple as this. Thanks for this post!

comment by MGR
Posted on January 26, 2012 at 20:13

You’re welcome. I’m glad you were able to make it work in the end.

comment by Engine101
Posted on February 20, 2012 at 21:25

Thank you soo much. As a total noob to Infopath, you really saved me with this one!

comment by MGR
Posted on February 21, 2012 at 13:34

That’s good to know. Good luck and have fun coding!

Leave a Response
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>