You need to sign in to do that
Don't have an account?
perumalvps
Is there option to increase CPU time limit
I have a scenario where too many calculations to be done with large volume of data to load a custom visualforce page report. I have almost avoided unnecessary loop in Apex code. Since it is more than 100k records, calculation is taking long time which is exceeding limit of 10000ms. So it is hitting CPU Limit Exceeded error. Is there a way to increase CPU time?
http://windows.microsoft.com/en-us/windows/using-memory-storage-device-speed-computer#1TC=windows-7
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_enhanced_future_overview.htm
In case if your still stuck with this. you can try to use @future to avoid the errors as future methods has 60kms time limit.
Hi perumalvps,
I am afraid that you can't use Future Method on VisualForce Pages. You will have to go for other workaround for this. One could be (As I don't know the whole scenario) -
You should do all the calculations in Future Mehod or Batch and put the necessary information in a custom Object. Once the batch is finished you can send an email that report is ready now.
On the Visualforce page you can have a button something like "Run Report now". While the batch runs you can disable the button. You can also have a Field on the Visualforce page that will show when the report was run last time.
I know it's a painful way, but it may help you.
Thanks,
Sumit Kumar Singh
@future method this method is fired when sources are available or your process is much longer
Thank You