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
Ashish RawandheAshish Rawandhe 

call controller apex class method from BatchApex finish()

I have VF page i am calling batchapex class from my controller class to perform update operation on records.Now after successfull updation using batchapex i want to display those updated record on VF page.
MKRMKR
Hi,

I would propose that you use apex:actionPoller to check if the batch job has completed and to refresh data when the job has completed. See here for instructions:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_actionPoller.htm

Regards,
Mkr
Ashish RawandheAshish Rawandhe
The job is completed updation is done but now i want to fetch those record.i want to call apex controller class method from the finish() of batchApex class that's not working 
MKRMKR
Hi,

It is not possible to update the users VF page from batch Apex. The page refresh needs to be initated by the VF page itself (action in practice). Thus I think actionPoller is your best bet as it can be used to check the status of the batch class and when it has completed, then it should refresh the component containing the updated data.

So the steps to do this:
  1. User action triggers the batch job
  2. VF page starts to poll for results with apex:actionPoller
  3. Apex batch job is processed asynchronously and completed (could take seconds or minutes)
  4. VF page detects that the batch job has completed
    1. It stops polling for results (disables actionPoller)
    2. Updates corresponding variable so that the component is refreshed
Regards,
Mkr
Ashish RawandheAshish Rawandhe
Ok Mkr i'll try this thanks for your quick response
 
brad leebrad lee
Thanks for your response and I like. Keep sharing the new things like this. Surveys are very popular at present. Most of the companies are interested to get feedback from the customers. https://tellthebell.ninja
MKRMKR
Hi,

Were you able to get this resolved? If yes, please select the provided response as a best answer as this will help others to find help in similar questions.

Regards,
Mkr
tulasi tayertulasi tayer
Hi, 
Thanks for sharing such a useful info.

see:https://breakonacloud.com/fix-voice-chat-not-working-fortnite/