Run a timer for every 3 months

In my case I want to write the timer for every 3 months, I have checked all the formats here

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Processes/Timer#runtime-properties

I could see how to run a timer every Sunday (for example "23:59 Sun"), is there any string for every quarter/3months?

Thank you.

Hello sohaib,

You can use a component from Forge to calculate and update the next run of the timer.

Please look at this component and try it.

Hope to help you.


BR,

Luis


sohaib javed wrote:

In my case I want to write the timer for every 3 months, I have checked all the formats here

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Processes/Timer#runtime-properties

I could see how to run a timer every Sunday (for example "23:59 Sun"), is there any string for every quarter/3months?

Thank you.



Hi,


You can check this link to see and understand all the possibilities that you have to configure what you need:

https://success.outsystems.com/Support/Enterprise_Customers/Maintenance_and_Operations/OutSystems_Platform_Timers_and_Asynchronous_Processes


Hope this can help.


Best regards,

Ricardo M Pereira

Hi,

One way to approach this issue may be to have the date of the next execution saved in the database and defining some logic with it at the head of timer.
For example, schedule the timer to run every Sunday, but only plan to process it on the first Sunday of each quarter. So at the head of the timer, validate whether it is the next execution date, if true, the timer is processed, otherwise the timer does not advance. When the timer processes, the new execution date should be recalculated and updated at the end of the timer.

Best Regards.

Hi Sohaib,

You can use Cyclic_Job (for multi tenant) or Cyclic_Job_Shared (for single tenant) entities from system espace and set its Next_Run attribute to schedule your next timer execution dynamically. So within your timer you can add this logic, calculate a date after 3 months and set it in the above attribute of your timer record in entity.the 

You check everything in detail about timer on the link given by Ricardo.

Hello Sohaib.

The largest unit you have is month.

A small trick you can do is:

  • set it to run once a month
  • check at start what month it is
  • If it is 1,4,7,10 do the rest, if not exit and try again in 30 days.

It the months will never change, it will be really easy to maintain.


If you plan on changing months, then keep the months on a table and timer will always check what months to accept/ignore.



Nuno Reis wrote:

Hello Sohaib.

The largest unit you have is month.

A small trick you can do is:

  • set it to run once a month
  • check at start what month it is
  • If it is 1,4,7,10 do the rest, if not exit and try again in 30 days.

It the months will never change, it will be really easy to maintain.


If you plan on changing months, then keep the months on a table and timer will always check what months to accept/ignore.



Hello Nuno,

That's another way to implement my suggestion above.

Cheers.