You need to sign in to do that
Don't have an account?
Kriti Khanna
Synchronous calling in apex batch
There is a main apex program calling batch apex for insertion. While batch insertion is still in progress, Next statements of Main programs are executed.
I want to execute the next statements only when apex batch processing is complete. Any way to do it?
I tried setting a flag in finish function of the batch apex and added wait in the Main program till the flag is set. But it gives CPU time limit exceeded error. Any way to bypass this issue?
I want to execute the next statements only when apex batch processing is complete. Any way to do it?
I tried setting a flag in finish function of the batch apex and added wait in the Main program till the flag is set. But it gives CPU time limit exceeded error. Any way to bypass this issue?
Try like below:
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
Varaprasad
@For SFDC Support: varaprasad4sfdc@gmail.com
Blog: http://salesforceprasad.blogspot.com/
Salesforce latest interview questions :
https://www.youtube.com/channel/UCOcam_Hb4KjeBdYJlJWV_ZA?sub_confirmation=1
What you can do it is ...
Call the apex batch using some time delay by using scheduler ..