Wednesday, May 21, 2014

InfoPath: The security validation for this page is invalid.

Hi guys

The error message in the title can quite often be a real head scratcher, but the very good news is that it is quite easy to get rid of. It happens when your InfoPath browser form executes custom code that calls directly into the SharePoint object model and specifically when you try to update the underlying SQL databases (i.e. when writing to s SharePoint list).

In your custom code, please make sure that you set SPWeb.AllowUnsafeUpdates to true before your code that updates the database. In addition, please set this value to false again afterwards to comply with best pratices.

Happy coding!

Hermann


No comments:

Post a Comment