We have a very large solution that we have been working on that utilizes a bunch of Query scripts to pull data back to the forms. Right now we have the Originator that is running the Queries and that data is being saved into the proper fields, but the Originator view does not have all those fields showing. When a combination of those Query scripts are run and then the Originator goes to submit the form, we are getting just a generic error "An unexpected error has occurred." We are finding that when all the Query scripts are run, the submit of the form always errors. When only a few of the Queries are run, the submit works fine. Is there a limit to how much can be in fields before someone can submit a form?
There is a security setting in SharePoint that prevents a certain amount of postback data and this key raises that limit.
If receiving a SharePoint correlation error ID when attempting to Save and Route a form and the SharePoint ULS logs show the correlation error contains ThrowIfMaxHttpCollectionKeysExceeded() in the debug message:
System.Web.HttpException: The URL-encoded form data is not valid. --- System.InvalidOperationException: Operation is not valid due to the current state of the object.
at System.Web.HttpValueCollection.FillFromEncodedBytes(Byte bytes, Encoding encoding)
Add the following to <appsettings> of the SharePoint web.config:
<add key="aspnet:MaxHttpCollectionKeys" value="5000" />
Microsoft Security Bulletin: https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2011/ms11-100