Monday, August 9, 2010

Setting Up a Batch Job to Run on the Last Day of Every Month

When setting up batch jobs sometimes you want it to run on the last day of every month. There isn't a specific way to do this on the recurrence tab in Dynamics AX unfortunately. However, there is a way, that is undocumented, to trick it into calculating the last day of every month.

On the recurrence form set the following options:

  1. Set the Starting time and Starting date.
  2. Configure the end date.
  3. Select Months for the Recurring pattern.
  4. Select the Repeat a specific day by a fixed interval option.
    1. Set the field Day to 32.
    2. Set the field Per to 1.
  5. Click OK.

This was tried with a leap year and worked successfully.