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. Bhargav

    Thank you so much.

    • MGR

      Glad I could be of help.

  2. AA

    thanks MGR.. you saved me a lot of hours.

    • MGR

      That’s great to read 🙂 Good luck with your work!

  3. Brian B

    Seriously, thanks. I remember accidentally selecting Edit Code and cancelling the editor that popped up and the next time (after many many updates over a long period of time yesterday) I tried to update/publish my form it gave me this error. Was freaking out cuz I didn’t know (noob as well) if it was one of the things I added or not. Saved me a ton of rework! 🙂

    Brian

    • MGR

      good stuff!

  4. Louise

    Thank you very much for this post, really struggling with this, it worked thank you

    • MGR

      no worries, glad you got it to work.

  5. MDJ

    SAVED ME HOURS OF WORK! THANKS! MERCI! GRACIAS!

    • MGR

      you’re very welcome 🙂

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.