Scheduled reports - Every month instead of every 4 weeks

Hello,

My problem is simple : we want to schedule a report to be send every month and not every 4 weeks.

I am sure we are not the only one to face this issue but, today, I don't find an easy well to solve it.

Best wishes,

Fred

  • Not a perfect, or easy, solution, but you could build a custom scheduler that sends a csv attached to an email and set it to run, say, at midnight on the 1st of the month by using the crontab format in the "Advanced Options" for the scheduling.

    Hopefully someone else has a better answer for you...

    FrancescaS

  • When you add 

    $app_list_strings['reportschedule_time_interval_dom']['2629800'] = "Every 1/12 year";

    to a custom/Extension/application/Ext/Language/en_us.xxxx.lang.php file you will get an interval equal to
    365,25 * 24 * 60 * 60 / 12 = 2629800 (sec)

    With that interval you divide the year in 12 parts of equal length.

    :-) :-) :-)

    Harald Kuske
    Principal Solution Architect – Professional Services, EMEA
    hkuske@sugarcrm.com
    SugarCRM Deutschland GmbH

  • Hello and ,

    thank you for your feedback but 1/12 of a year is differrent then the 1st (or the 15th of a month) and we would like to keep on working with core report scheduler.

    So I would rather find a way to override the getNextRunDate from modules\ReportSchedules\ReportSchedule.php in order to manage another type of "dropdown key" (instead of having only duration, maybe other textual key)

    Fred

  • I gave this some more thought... 

    The interval used in calculating the getNextRunDate is an integer, a number of seconds, so it's useless for what you are trying to do.

    As you said, the logical thing would be to extend or override the getNextRunDate.

    I do NOT think this will work well at all but I'll share anyway just as a fun discussion:

    The only way I can think of to try and modify the getNextRunDate:

    Add a custom dropdown field to the ReportSchedules module to override the interval. Tricky because ReportSchedules are not in Studio, so you would have to do so in code, potentially not part of the Extension Framework?

    Let's call the field something like RepeatTypeOverride to make it obvious.

    Define a new dropdown with the values you need, something like: 

    "FDM" => "Each First Day of the Month",

    "LDM" => "Each Last Day of the Month"

    extend the getNextRunDate method in the ReportSchedule class within the framework - and I don't know if you can - to check if RepeatTypeOverride has a value, if it does then see what it is and do the calculation to update the time_interval to whatever number of of seconds until the next desired run

    It's clunky but it might work...

    So if FDM, something like:

    $d = new DateTime();
    $date = $d->modify( 'first day of next month' );
    echo $date->format('Y-m-d H:i:s');

    Will give you the date timestamp of this time on the first of next month.

    It's then a question of calculating the number of seconds between that date-timestamp and the current date-timestamp and using that to update the interval... 

    You should probably also extend the save method to set the appropriate time interval when the scheduler is first saved or updated, else the first run will not be what might be expected.

    As I said, it's clunky... very clunky...

    Good Luck, I look forward to seeing if you find a solution.

    FrancescaS

  • Just to add that we have the same question...   

    Surely this is something that SugarCRM can update...   When 11.3.0 arrives we can now attach a .csv to a scheduled report, so that is a great addition.  This seems like the logical next step.

    Every 4 weeks makes no sense and ends up out of sync with the months...   I have to schedule things for every week and ask folk to ignore what they don't want!  But it still really ought to tie in with months and quarters at least.  At best maybe do it like CRON?

    Salesforce can do every month, and more...  (just sayin' Yum)

    How can we formely request this? Raise a case?

    It must be a really common issue?  I expect like me most admin's just run the report and email it to folk at the right time!

    Luke.

  • Hi Luke,

    We have also the same "problem" to send a report every month instead of every 4 weeks ... this is a simple thing and that's a pity this has never been put on the top of the backlog.

    I think if we all raise a case as Enhancement Request maybe we can have a chance to get this implemented in a few releases... :-)

    Best regards,

    Enes

  • Hi ... DONE :-)

    I raised a case as per the following:

    Suppose it would also be good to vote up on the Bugs too?   But I will settle for some report schedule updates instead ;-)...    All this said, I do like alot of the features comning in 11.3.0.   I am very pleased with Sugar's progress..  this is not a cpomplaint y any means...  just what it says on the tin: an enhancement request.


    My case:

    Dear Support..

    It would be really beneficial to chose a date like 1st of every month when sheduling a report. or nth of evry nth month, a bit like cron I suppose.

    I found these which also relate:

    79010 Scheduled Report: Offer More Frequent Time Interval Options
    https://portal.sugarondemand.com/#supp_Bugs/f118ca16-5234-11e7-9c05-d4bed9b70c64" target="_blank" rel="nofollow noopener noreferrer">https://portal.sugarondemand.com/#supp_Bugs/f118ca16-5234-11e7-9c05-d4bed9b70c64
    &
    63288 Scheduled Reports Should Have Month/Year or Irregular Period Options
    https://portal.sugarondemand.com/#supp_Bugs/8279a453-f6b3-6da0-3097-51a4d634740d" target="_blank" rel="nofollow noopener noreferrer">https://portal.sugarondemand.com/#supp_Bugs/8279a453-f6b3-6da0-3097-51a4d634740d

    It would also be amazing to be able to:
    - send from the user OR the system email (to have a the choice).
    - to add the TO email manually, and it not need to be an existing sugar user.
    Not everyone in our business has a sugar licence, but some reports from CRM will really benefit them. Like returns reports for engineering, for one example.


    Hopefully this is a nice way to get Sugar eyes on this enhancement.

    Thanks Enes.

  • Hi ,

    it's cool if you created a case for this(one of the bug was created after we created a case in 2017 for the same issue!) ; so, I hope that if more partners / customers asked for this feature, we could get a chance of having this feature (and also your other good suggestions) done.

    Fred

  • Just for folks info here is the reply from SugarCRM Support and the subsequent links to the enhancement requests...  (Thank you Support)


    This functionality is currently not available in the application.
    For the first issue: send from the user OR the system email:
    I have added your case to enhancement request #68669 ( https://portal.sugarondemand.com/#supp_Bugs/68669 ).


    Rot the second issue: add the TO email manually, and it not need to be an existing sugar user.
    I have added your case to enhancement request #75844 ( https://portal.sugarondemand.com/#supp_Bugs/75844 ).


    Best regards all,
    Luke.

  • Hi Fred, Clubmates,

    If to separate automation of reports sending from automation of scheduling of reports sending, there could be a fairly simple solution for this particular case.

    We may add an item e.g. 0 [One-Time Run] to the dropdown reportschedule_time_interval_dom and then create 12 records in the Reports Schedule - one per each month of the year, setting the desired Stat Date for each record with One-Time Run in Repeat time.

    This will make each Report Schedules record run only ones - on the Start Date specified

    The handy copying of Report Schedules records allows to easily schedule the monthly reports sending on the desired date for the next 10 years just in 10-15 minutes of our time.
    The only thing to check is the proper schedule for running a job Run Report Generation Scheduled Tasks.

    I hope this works for the case

    Best Regards,
    Dmytro Chupylka

    integroscrm.com
    We make work in Sugar CRM system faster, more convenient and efficient