You need to sign in to do that
Don't have an account?
penchala raju
how to display the records fetching from batch apex start() method
global class batchupdate implements Database.Batchable<sobject>
{
global Database.QueryLocator start(Database.BatchableContext bc)
{
return Database.getQueryLocator('select id,name,industry from account');
}
global void execute(Database.BatchableContext bc,list<account> scope)
{
list<account> cust=new List<account>();
for(account c:scope)
{
c.name='mr'+c.name;
cust.add(c);
}
update cust;
}
global void finish(Database.BatchableContext bc)
{
}
}
batch execution:
batchupdate bp=new batchupdate();
Database.executeBatch(bp,5);
here i divided 5 batches.i want to display these records in visual force
{
global Database.QueryLocator start(Database.BatchableContext bc)
{
return Database.getQueryLocator('select id,name,industry from account');
}
global void execute(Database.BatchableContext bc,list<account> scope)
{
list<account> cust=new List<account>();
for(account c:scope)
{
c.name='mr'+c.name;
cust.add(c);
}
update cust;
}
global void finish(Database.BatchableContext bc)
{
}
}
batch execution:
batchupdate bp=new batchupdate();
Database.executeBatch(bp,5);
here i divided 5 batches.i want to display these records in visual force
http://www.tehnrd.com/batch-apex-status-bar/
Please let us know if this will help you.
you cant user batch apex to fetch data for a visual force page as batch apex is executed asynchronously .could you eloborate your requirement .
normaly batch apex is used to large dml operations within govenor limits.