I need to get dynamic query result which returns rows more then 50K. Database.query() has 50K limit so I am trying to use Database.executeBatch(). On click of apex button, I want to display rows in apex:repeat. executeBatch returns rows in execute method which does not update apex:repeat control.
Following is the code:
//called by apex button to display result in apex:repeat control
public PageReference searchUsers(){
....
...
id batchInstance=Database.executeBatch(this,200);
...
return null;
}
global Database.QueryLocator start(Database.BatchableContext BC)
{
return Database.getQueryLocator(Query + ' LIMIT 200');
}
global void execute(Database.BatchableContext BC,List<SObject> scope)
{
//Want to update apex:repeat control with the result
}
global void finish(Database.BatchableContext bc)
{
}