You need to sign in to do that
Don't have an account?
itsDone
How to calculate /fetch total number of opportunities in an org without hitting 50000 row limt
How to calculate /fetch total number of opportunities in an org without hitting 50000 row limt for SOQL ?
Thanks in advance!
try like this
Integer i = [select count() from opportunity];
I tried this, row limit still applies to count()
then its better to use for loop then
list<opportunity> lstid = new list<opportunity>();
for(opportunity opp : [select id from opportunity])
lstid.add(opp.id);
integer icount = lstid.size();
but sure there is a work around...but for the time being i got this solution
then its better to use for loop then
list<opportunity> lstid = new list<opportunity>();
for(opportunity opp : [select id from opportunity])
lstid.add(opp.id);
integer icount = lstid.size();
but sure there is a work around...but for the time being i am posting this
As soon as Winter 12 is released you can create a small static method with the @ReadOnly annotation.
It allows an unlimited record count. All you need is [Select Count() FROM ***** ]; inside the method.