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.
Thank you so much.
Glad I could be of help.
thanks MGR.. you saved me a lot of hours.
That’s great to read 🙂 Good luck with your work!
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
good stuff!
Thank you very much for this post, really struggling with this, it worked thank you
no worries, glad you got it to work.
SAVED ME HOURS OF WORK! THANKS! MERCI! GRACIAS!
you’re very welcome 🙂