Quick tip: Remove code from an InfoPath form to allow it to be filled in on the browser

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.

MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

30 thoughts on “Quick tip: Remove code from an InfoPath form to allow it to be filled in on the browser

  1. Steve LaMotte

    Thank you, this was a great help

    • MGR

      Happy to hear 🙂

  2. Nette

    You saved my day 🙂

    • MGR

      =) glad to hear!

  3. Ana Bee

    Thanks! This worked perfectly! I thought someone changed something on the servers,

    • MGR

      It’s such a frustrating little thing! Glad you finally fixed it =)

  4. Fur

    Thanks! I thought I foobared the whole project!

    • MGR

      No worries. It’s a bit silly that you have to go through this process, not exactly straightforward to think of it, but, yeah, it’s that simple to make it work again. Glad you found this helpful.

  5. mosotho

    Thanks boet, i was ready to punch t punch the screen

    • MGR

      hahaha =) Glad I could be of assistance. Don’t punch the screen 😛

  6. Lea Ann

    Thank you so much, your post was a life-saver!

  7. Dilbert

    Ok.. after two phone calls to Microsoft and a post on the Technet with no answers this fixed my issue. I am definately giving you the credit on the post. Thanks much.

    • MGR

      It’s always the little things, right? This had driven me crazy as well! I was so relieved when I found it.
      Glad this helped you Dilbert.

  8. Dave Winters

    One more Kudo. Good find on Google for Infopath 2010 & SP 2010 Enterprise. I’ll be back for more tips.

  9. Engine101

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

    • MGR

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

  10. Brandon Fletcher

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

    • MGR

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

      • pritidesai

        Great… I was struggling with this from long

        • MGR

          It’s a frustrating thing, I know! Glad you found this helpful 🙂

Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.