+ Start a Discussion
xwzuxwzu 

BATCH APEX IN VISUALFORCE CONTROLLER

How use batch apex in controller and display the list of records that processed by batch to display on visualforce . If any one have the code then it will be very helpful.Thanks in advance

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

You can get at the number of batches processed by querying the AsyncApexJob sobject and extracting the JobItemsProcessed field.  If you need more granularity than that you'd need to have your batch apex write information to the database that the Visualforce controller can extract for display I think.

All Answers

bob_buzzardbob_buzzard

You can get at the number of batches processed by querying the AsyncApexJob sobject and extracting the JobItemsProcessed field.  If you need more granularity than that you'd need to have your batch apex write information to the database that the Visualforce controller can extract for display I think.

This was selected as the best answer
snippets@sfsnippets@sf

Hi need a simillar solution too.

 

any sample code that you can share