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
JNicJNic 

Scheduled Reports Runtime Limits

Hi all,

 

I have a scheduled report that needs to go out via email at 9:30 am every morning - not 9 or 10 (it's currently set to run at 10:00 am which is too late).

 

I understand the reporting limitations and I beleive reports can be scheduled to run every hour. More details can be found here: http://www.salesforce.com/us/developer/docs/packagingGuide/Content/dev_package_limits_for_pe_ge.htm.

 


What is the best practice when it comes to building such custom scheduled reports that can meet above requirement (AKA Runtime of every half  hour)?

 

Ideally, I would like such capability to be offered through the out-of-the-box features.

 

 

Kindly provide youre comments.

 

 

Regards,

 

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

1. Use scheduled apex - you can specify a cron string to fire at a certain time every day and you can set this up via anonymous apex.  Check the docs at :

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm

 

2. Visualforce charting relies on javascript in the client, so you might not have much success with that depending on what your recipients use.  I've tended to avoid charting for that reason.

All Answers

JNicJNic

Thoughts?

bob_buzzardbob_buzzard

For reports, you only have the capability to schedule on an hour (although there's no guarantees that is when it will run, that is simply when you request it to run and the actual time will depend on the salesforce instance load).

 

I'm not aware of any way to influence this - if I need to do things at a lower level of granularity than hourly, then I use scheduled apex and a cron string that defines the minutes past the hour.  That won't work for reports though - I've ended up having to recreate the report in Visualforce in the past.

JNicJNic

Thank you Bob for your input.

 


If I wanted to build this through apex, there will be two elements to consider - please correct me if I'm wrong:

  1. Scheduler - I need to somehow define when the scheduler needs to run and fire some apex email services. Basically, I'll need to build a timer.
  2. Apex email service - through an apex class, I'll need to query for the records and gather them in a visualforce (of type PDF or excell) and embed them in the email as an attachment ( or in the body of the email).

 

For element # 1, how would I be able to bypass the timer for the weekends? (The requirement is to generate these reports on business days only).

For element #2, is Visualforce charting the right way to go?

 

Thank you again for your guidance.

 

Thanks,

 

 

bob_buzzardbob_buzzard

1. Use scheduled apex - you can specify a cron string to fire at a certain time every day and you can set this up via anonymous apex.  Check the docs at :

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm

 

2. Visualforce charting relies on javascript in the client, so you might not have much success with that depending on what your recipients use.  I've tended to avoid charting for that reason.

This was selected as the best answer
JNicJNic

Thank you Bob for your great insight.