You need to sign in to do that
Don't have an account?

SOQL query return records and return list size does not match
Hi, I have a code like below
list<Lead> lstLead = [select Id, Name from Lead]; //line 8
system.dedug('----size---'+lstLead.size()) ; // line 9
In debug log
============
Line 8: returns 16120 Rows.
Line 9: debug prints==> ----size---16074
How this is possible? Can anyone help me?
Thanks.
The code is below
global with sharing class LeadGaugeController{
@RemoteAction
global static List<AggregateResult> getData() {
return[select COUNT(id) numLeads , Status stg
FROM Lead WHERE Createddate < LAST_WEEK and Status ='Open' GROUP BY Status LIMIT 1];
}
public List<Lead> getStuck_Leads() {
list<Lead> lstLead = [select FirstName,LastName, Name,Title,Company,Street,LeadSource,Delivery_Street__c,Email,Owner.Name,Rating,IsUnreadByOwner
FROM Lead WHERE Createddate < LAST_WEEK and Status ='Open'];
system.debug('---size-----'+lstLead.size());
return lstLead;
}
}
debug log
========================================
Thank you. But unfortunately it is not same. What should I do now?
Weird, but interesting.
I want to know what's the difference.
If I were you, I will try to limit the query and find out what causes the difference.
list<Lead> lstLead = [select ...
FROM Lead WHERE Createddate < LAST_WEEK and Createddate > LAST_MONTH and
Status ='Open'];
system.debug('---size-----'+lstLead.size());
In Developer console, I tried the query what I posted. It is showing same records in "Return Rows" and "---size---". But Visual force page displaying different in "---size---"(less records).