You need to sign in to do that
Don't have an account?
How do I implement Query more in Apex?.
Hi All,
This is the scenario we are working with and are having an issue looking for a solution.
I am trying to retrieve more than 1000 records in an Apex Query and apparently 1000 is the upper limit to the number of records that can be retrieved.
Dose any one know of a query more in a trigger or how to implement this.Below is the query:
for (Lease_Com__c[] leaseCommission :
[select Id, lease_nbr__r.Name, gcp_amt__c, lease_nbr__r.End_User__c, lease_nbr__r.Funded_Dt__c from lease_com__c
where OwnerId = :UserID
and lease_nbr__r.Funded_Dt__c < :dtBeginningOfNextMonth
and lease_nbr__r.Funded_Dt__c >= :dtBeginningOf6MonthsPrevious
order by lease_nbr__r.Funded_Dt__c desc] ) {
}
Vivek Viswanathan
[select Id, lease_nbr__r.Name, gcp_amt__c, lease_nbr__r.End_User__c, lease_nbr__r.Funded_Dt__c from lease_com__c ])
this for loop will handel the functionality of queryMore itself.
Thanks,
Divya
Have you been able to get this for loop SOQL Query to work with more than 1000 records? I have tried to run a count of the number of records returned with the following query but still recieve the error saying there are too many rows...
Would appreciate any advice.