When I'm trying to use Execute Anonymous with a large chunk of code, the following error pops up:
Line: undefined, Column: undefined
Response to EXEC was : . HTTP CODE[414]
(414 stands for Request-URI Too Long)
Sometimes I just need to remove a few tabs and line breaks to make the request short enough. Is there any way to bypass this limitation, or maybe there is another way to quickly execute a script without creating a new class?
Best Answer
The Developer Console is using the REST version of the Tooling API to perform the execute anonymous call. The length issue is a restriction of how the call encodes the apex into the URL.
It is URL encoding your Apex onto the query string. Clearly there are limits to how long this can be.
I found a few viable alternatives.