You need to sign in to do that
Don't have an account?
Ab
Refresh part of page at the end of Future method
Hello,
I have a trigger, which has future method in it.
This future method updates the fields or the trigger object.
I want to implement something which will refresh the part of the page , after the end of future method.
I have a trigger, which has future method in it.
This future method updates the fields or the trigger object.
I want to implement something which will refresh the part of the page , after the end of future method.
You can have a Static variable, to track whether the future method is executed or not. Also have a check box in the page and Once the static variable, becomes true, update that check box value to True. And in the page, based on that check box, you can render ro do some modifications
All Answers
First if you are using future method in Trigger than you need to follow best practise. Because furture method exceed the limit in Trigger if the reocrd are more than 50. You need to write code in that way future method invoked once only.
And future method runs in the background, asynchronously so nobody know when will be the method complete.
You can try or use PushNotificaiton on page, when ever the record is updated then through pushnotification you can get the record value is updated and you need to refresh the page.
-Thanks
Ashlekh Gera
You can have a Static variable, to track whether the future method is executed or not. Also have a check box in the page and Once the static variable, becomes true, update that check box value to True. And in the page, based on that check box, you can render ro do some modifications
Can you a provide a quick example using the code, how would you refresh the part of a vf page, once the future method is completed?
Thanks,
Sachin