function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Yogesh Malbhage 18Yogesh Malbhage 18 

MALFORMED_QUERY : [object Object] : truncated error in SOQL

Hi,

I am getting "MALFORMED_QUERY : [object Object] : truncated" error in SOQL while querying on EmailMessage object. I am not getting why "MALFORMED_QUERY " and what is truncated?
Please help me out through this ASAP.

Query:
SELECT toIds FROM EmailMessage WHERE field1=tempvar AND Status__c NOT IN ('Rejected', 'Queued')
NimitNimit
Hi Yogesh,

Seems like your query result is giving more than 500 records..

Please try to add limit in the SOQL and see if it works.

Regards,
Nimit
Yogesh Malbhage 18Yogesh Malbhage 18
Hi Nimit,

Thanks for your response.
 
Yogesh Malbhage 18Yogesh Malbhage 18
Nimit,
But as far I know the governor limit on number of records returned by SOQL is 50000 records. Then why this limit of 500?
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm
Yogesh Malbhage 18Yogesh Malbhage 18
How can I fetch records more than 500?