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
Krishna BandiKrishna Bandi 

Internal Salesforce.com Error

Hi,

I am getting "Internal Salesforce.com Error" while executing the below SOQL statement

list<CustomObject> calls1MonthList = new list<CustomObject>();
calls1MonthList = [select Id, CreatedById from CustomObject where CreatedById in : 'Passing User Ids' and createdDate>:system.today().addDays(-60) and RecordTypeId =:'record Type ID here'];

I tried it by adding more filters into the query, however it does work for couple of times and again it starts giving me the same error.
Ramu_SFDCRamu_SFDC
Try setting the date to a date variable and use it in the query.
Sfdc CloudSfdc Cloud
Try this one ..its working fine in my org
list<CustomObject> calls1MonthList = new list<CustomObject>();
Date d=System.today()-60;
calls1MonthList = [select Id, CreatedById from CustomObject where CreatedById in= 'Passing User Ids' and createdDate>:d and RecordTypeId =:'record Type ID here'];

If this help you out Please marks it as a best Answer to help others :)
Krishna BandiKrishna Bandi
Hi Guys,

It's working if I run the process manually from Developer console however it is working if I schedule the Job.
There are 1600000 records in this object, does the volume of the data is causing issues.
Any help is greatly appreciated.