[SalesForce] The value of the “” parameter contains a character that is not allowed or the value exceeds the maximum allowed length

I have a managed VF page that is displaying the above error when an action link is clicked -only in a particular subscriber sandbox (it has been working fine in every other org). The link sets a variable in the controller (call it selection) and re-renders a panel whose content is shown when selection is set. This panel should display a few things that were fetched via getter methods. Instead the page suddenly is going blank with this error message:

Unable to Access Page

The value of the "" parameter contains a
character that is not allowed or the value exceeds the maximum allowed
length. Remove the character from the parameter value or reduce the
value length and resubmit.

I don't want to get into the code here as I am just trying to see why the parameter in this message is resolving to blank. The Debug Logs are not showing anything at all even with logging levels set to Finest.

I have done my research and seen other similar posts on SFSE, but my issue is with the blank parameter. I am hoping that with this knowledge I can figure out the next step.

Best Answer

Turned out Apex was throwing this exception:

System.InvalidParameterValueException: Custom Setting Name too long: ...

with the offending line being:

MySetting__c.getValues(veryLongValue);

This was part of a getter method that was supposed to return a list of SelectOptions.

I still don't understand why this was causing the page to break with such misleading message. I experimented with a few other exception types -including null pointers as well as custom exceptions- and they all displayed appropriate messages on the page.

Related Topic