I have written an apex batch that was working before sendbox refreshing. When I try to run the batch I get this message in the Status Detail:

First error: invalid character encoding

Instead in the debug log I get error in the status:

Internal Salesforce.com Error

Is there someone who know what is going on? Thank you all.

  • Further investigation revealed that the batch job does not start if the result set is larger than 500 rows. So I have tried to limit the query to 500 rows: query += ' WHERE IsClosed = true LIMIT 500'; and Batch works without issues. If I try with more rows (550 or 600 up) I obtain the same error. Since function used, Database.getQueryLocator, is specified to allow 50 million rows, and I data are around 80 000, there is no obvious explanation to this change in behavior. – MarcoDev Dec 29 '14 at 14:57

I have removed some fields. It seems that if there are too many data in an environment and the query structure is complex you get this kind of error.

  • Good advice, mate! – user9959 Jan 27 '15 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.