Schedule Report to run last day of month.

I need to run a report after close of business on the last day of every month. eg. at 9pm. How do I set up a schedule to do it?

can I set a workflow to run a report?

Can I add a new entry in the schedule dropdown list

Or create a formula that will trigger it to run?

There is an enhancement request for this feature going back to 2011, so I guess the powers that be don't think it's worth doing.

Parents
  • Hello Howard Jennings

    Last of every month, can also be considered as Starting of the month. 

    0 0 1 * * - On the hour; 12:00am; 1st

    This executes on 1st of every month, at 12 AM

    If this doesn't satisfy you, then you probably has to create 4 schedulers.

    1. Execute at every 31st day (of these months) - 0 0 31 1,3,5,7,8,10,12 * - On the hour; 12:00am; 31st; January and March and May and July and August and October and December

    2. Execute at every 30th day (of these months) 0 0 30 4,6,9,11 * - On the hour; 12:00am; 30th; April and June and September and November

    3. Execute at 29th of Leap year of Feb - This can be ignored if the step 4 is set

    4. Execute at 28th of non leap year of Feb - 0 0 28 2 *

    This is just an idea!!

    Best Regards,
    Sravanthi B

  • Hi Sravanthi

    Thanks very much for your reply, I'm glad it looks like there's a way. Where do I enter the numbers you've given?

    Thanks

    Howard

  • Hello Howard,

    While configuring a scheduler, this setting can be done at the interval field that you see. You should have to be entered as 5 input values hence I have given 5 numbers accordingly.

    https://support.sugarcrm.com/Documentation/Sugar_Versions/8.0/Ent/Administration_Guide/System/Schedulers/ 

    Best Regards,
    Sravanthi B

  • Ahhh. I was looking in the 'Schedule Report' not 'Schedulers' in Admin. Now I see where to enter the numbers. Idealy running it just before midnight would be better. But the other thing I can't work out is how to tell it which report to run. There isn't a 'Run a report' item in the 'JOB' dropdown. Am I missing something.

    please reply as if I am stupid, because I probably am.

  • Hi Sravanthi Bellamkonda and Howard Jennings,

    Limiting when the scheduler runs impacts all scheduled report run times. The scheduler reads the database for all scheduled reports with a field like next_run having a past date, and runs those, regardless of whether that date was a minute ago or five years ago.

    This means that if you set your schedule to only run at the end of the month, but you have a scheduled report set to run every week, that scheduled report won't run every week. It will run the one time the scheduler runs, at the end of the month.

    Howard, this is a creative solution, but since you seem to only want this for a subset of your reports, not all of them, this does not seem to be a solution that will solve your use case.

    I hope this helps.

  • Hi Patrick, good to hear from you.

    We don't knowingly have any scheuled reports, so only running them once a month won't cause any problems, not for us anywany. I don't know if it will affect any automatic maintenance that happens.

    Do you have any other sollution, other than bludgeoning your developers to add the options?

    Howard.

  • Hi Howard Jennings,

    I am not sure what you refer to regarding automatic maintenance. Each scheduler only impacts the part of the product it is coded to impact. The scheduler for scheduled reports will only affect when scheduled reports run, so if the only scheduled reports you intend to run are these at the end of the month, then the inability to pick which reports it impacts is moot, as it will impact all scheduled reports.

    No, apart from this, I do not have an idea for this one that does not involve custom code.

Reply
  • Hi Howard Jennings,

    I am not sure what you refer to regarding automatic maintenance. Each scheduler only impacts the part of the product it is coded to impact. The scheduler for scheduled reports will only affect when scheduled reports run, so if the only scheduled reports you intend to run are these at the end of the month, then the inability to pick which reports it impacts is moot, as it will impact all scheduled reports.

    No, apart from this, I do not have an idea for this one that does not involve custom code.

Children
  • Hi

    Looking at the schedules they all seem to be stock ones, i.e. ones that come with Sugar or ones that are added automatically by sugar after I've modified something. I don't know as I've never used schedulers before.

    Assuming I go this route, which is likely, unless I can use an API to run it, which 'Job' do I select? I can't see any that say 'Run Report' or similar. Or do I create a new job some how?scheduled job list

    Art was a strong subject for me at school

  • Howard Jennings,

    I recommend using the stock scheduler that is already in place called "Run Report Generation Scheduled Tasks" described here.

    I do not see any benefit in setting up a second scheduler with the same function as the stock scheduler.

  • Thanks. I've set up a schedule and I'll have a play.

    Thanks for your help