You need to sign in to do that
Don't have an account?
Ashish 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.
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
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:
- User action triggers the batch job
- VF page starts to poll for results with apex:actionPoller
- Apex batch job is processed asynchronously and completed (could take seconds or minutes)
- VF page detects that the batch job has completed
- It stops polling for results (disables actionPoller)
- Updates corresponding variable so that the component is refreshed
Regards,Mkr
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
Thanks for sharing such a useful info.
see:https://breakonacloud.com/fix-voice-chat-not-working-fortnite/