function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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