Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Batch Job Recurrence Settings Pipe Dream

Posted on by 1,624

I know this is something a lot of people would love to see in AX, so I'm hoping someone has spent the time and energy to figure out a way to do this.  If you have, I would love to get some tips, tricks, pointers, or website to show how to do this.  Here is what I'm looking for:

Weekdays from 6am to 4pm every 10 minutes

Below is a screenshot I threw together as a concept.  I have been able to change the code to show these fields but they don't function.

Dream.jpg

  • Verified answer
    FAC.Ansel Profile Picture
    FAC.Ansel 1,624 on at
    RE: Batch Job Recurrence Settings Pipe Dream

    Thanks everyone for your responses.   I will still need to create a customization at some point to get exactly what I want but in this specific instance I was able to solve my problem without customization.  I put my batch job in a batch group that was assigned to an AOS that only runs the batch server during the times that I need.  This wouldn't work for everyone and doesn't allow a lot of flexibility but it was a quick fix that seems to be working.

  • Verified answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,147 on at
    RE: Batch Job Recurrence Settings Pipe Dream

    I have implemented similar functionality and referred to as Batch Time Fencing before.

    Our goal was to be able to tell that between what time shall a batch job run, but it can be easily expanded with days.

    1) You would need a table which holds the information that when can it run.

    2) Change SysRecurrenceBuild class by adding an additional datasource and grid from code in the build method, and store the table values in a packed format in the update method

    3) Change SysRecurrence class to take care of the reset method to empty your time fence table, or to include a default value

    2) Change BatchRun class to skip picking up the next entry if the current time does not fall within the recurrence settings packed in your table for the batch task in the serverGetTask and serverGetOneTask methods

    You would need to clearly understand how the framework works, to be able to implement it correctly.

  • Suggested answer
    Andrew Xu Profile Picture
    Andrew Xu 3,877 on at
    RE: Batch Job Recurrence Settings Pipe Dream

    Hi Ansel,

    Your requirement includes,

    1. Start time and end time (could be replaced by interval and count)

    2. Recurring pattern in minute

    3. Recurring on specific days

    But AX batch job recurrence only provides the control on

    1. Start time, count

    2. Recurring pattern in minute or Recurring on specific days.

    So as my understanding, AX cannot cover your requirement with the recurrence setting. You can either program the recurring pattern in minute or recurring on specific days in that job to realize the logic.

  • Suggested answer
    ColbyGallagher Profile Picture
    ColbyGallagher 3,664 on at
    RE: Batch Job Recurrence Settings Pipe Dream

    Yes, this is very do-able, but its a mod.  We've done it for clients before.

  • FAC.Ansel Profile Picture
    FAC.Ansel 1,624 on at
    RE: Batch Job Recurrence Settings Pipe Dream

    Yes.  I'm just looking to have the job run every weekday starting at 6am, every 10 minutes till 4pm.  

    Right now I have the job running every 10 minutes, but there are other tasks that users need to complete and they don't want to stop the batch job and restart it every time they need to do a task.

  • Andrew Xu Profile Picture
    Andrew Xu 3,877 on at
    RE: Batch Job Recurrence Settings Pipe Dream

    Does your 'Weekdays from 6am to 4pm every 10 minutes' mean 'Start at 6 am and exeute the job 60 times with 10 mins as the interval"?

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans