+ Start a Discussion

System.UnexpectedException: Internal Salesforce.com Query Error

I have a managed package with Account and Opp queries in it. My tests work fine.


In one org the package installs and works fine in a recent sandbox, but in production it's getting this error:


System.UnexpectedException: Internal Salesforce.com Query Error


There is no line number associated with the error.


Any ideas?








Open a case with support, they're the only ones who can dig into the internals of the error.


But some things that have helped me in the past include:


  • Include your namespace prefix explicitly in the query, rather than relying on it being added implicitly. (SELECT prefix__myField__c FROM Account rather than SELECT myField__c FROM Account).
  • Try not using any methods or fields from the standard controller is possible, I've had issues with them one rare occasions.
  • Make sure all your custom fields are deployed in the org you're testing in.