Changes in execution time for recurrent job queue entry

gtrennert2gtrennert2 Member Posts: 23
Hello
I created a codeunit with one only code : sleep(180000) meaning the execution time will be 3 minutes
I published on BC Version: FR Business Central 19.2 (Platform 19.0.32956.36014 + Application 19.2.32968.33612)
Then I created a JobQueue Entry for this Codeunit, with "Recurring Job" checked (every day) and "Starting Time" at 13:25
The I set Status to Ready
The "Earliest Start Date/Time" is automatically set to "21/02/2021 13:25"
After the first execution the starting time for the next day the "Starting Time" stays at 13:25
But the "Earliest Start Date/Time" is automatically set to "22/02/2021 13:28"
This means that the execution time will change every day from 13:25 to 13:28 to 13:31 and so on
How can this be avoided - the execution time needs to stay at 13:25
Thanks

Answers

  • BertVerbBertVerb Member Posts: 24
    That cannot be avoided. The job queue calculate all ways the execution time in it.
    What I do mostly in that cases I create a logic app for it.

    Or maybe after the report you will reset the date and time in the job queue. But that I'm not sure if that is possible.
  • vaprogvaprog Member Posts: 1,116
    Check out this example in the Microsoft docs.

    You need to set the earliest starting time in addition, or else the first run will be immediate, but the next scheduled run will be at your set start time.
  • rkaufmannrkaufmann Member Posts: 71
    @gtrennert2
    Did you find a solution to this problem? I have the same problem here.
    I want to run a job from 6 AM to 6 PM every hour, but the start time changes over the day, because the next starting time is always calculated from the ending time of the last run plus the number of minutes between executions. Thats not good at all.
  • taky6086taky6086 Member Posts: 1
    @rkaufmann Pls, did you find a solution to this problem?
Sign In or Register to comment.