{"title":"Codeunit 448 Job Queue Dispatcher, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/448-job-queue-dispatcher/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-11-19","object":{"type":"codeunit","id":448,"name":"Job Queue Dispatcher","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/448-job-queue-dispatcher/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/448-job-queue-dispatcher/source/","path":"src/Layers/W1/BaseApp/Modules/System/JobQueue/JobQueueDispatcher.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"codeunit:9803":{"name":"Job Queue Telemetry","url":"https://jonas-paprotka.de/ref/codeunit/9803-job-queue-telemetry/"},"table:472":{"name":"Job Queue Entry","url":"https://jonas-paprotka.de/ref/table/472-job-queue-entry/"},"codeunit:449":{"name":"Job Queue Start Codeunit","url":"https://jonas-paprotka.de/ref/codeunit/449-job-queue-start-codeunit/"},"codeunit:453":{"name":"Job Queue - Enqueue","url":"https://jonas-paprotka.de/ref/codeunit/453-job-queue-enqueue/"},"codeunit:53":{"name":"Translation Helper","url":"https://jonas-paprotka.de/ref/codeunit/53-translation-helper/"}},"procs":[{"name":"OnRun","line":13,"kind":"trigger","steps":[[17,"event","OnBeforeRun",0],[19,"ext","codeunit",9803,"SendJobQueueSkippedTelemetry",1],[24,"call","RunCleanupForCurrentJob",1],[27,"ext","codeunit",9803,"SendJobQueueNotReadyToStartTelemetry",1],[34,"ext","codeunit",9803,"SendJobQueueExpiredTelemetry",1],[38,"call","IsWithinStartEndTime",1],[39,"call","Reschedule",1],[40,"ext","codeunit",9803,"SendJobQueueRescheduledDueToStartEndTimeTelemetry",1],[43,"call","WaitForOthersWithSameCategory",1],[44,"call","RescheduleAsWaiting",1],[45,"ext","codeunit",9803,"SendJobQueueRescheduleAsWaitingTelemetry",1],[48,"call","HandleRequest",1],[55,"call","CleanupCurrentUsersJobsWithSameCategory",1],[56,"call","CleanupStaleJobs",0]]},{"name":"HandleRequest","line":76,"kind":"procedure","access":"local","params":1,"steps":[[83,"event","OnBeforeHandleRequest",0],[92,"write",472,"Modify"],[95,"ext","table",472,"InsertLogEntry",1],[99,"event","OnBeforeExecuteJob",0],[102,"run","codeunit",449],[105,"event","OnAfterSuccessExecuteJob",0],[109,"ext","table",472,"DoesExistLocked",0],[110,"ext","table",472,"SetResult",1],[112,"call","SendTraceOnFailedtoGetRecordBeforeUpdatingStatus",1],[113,"ext","table",472,"SetResultDeletedEntry",0],[117,"ext","table",472,"FinalizeLogEntry",1],[119,"ext","table",472,"DoesExistLocked",0],[120,"ext","table",472,"FinalizeRun",1],[122,"call","SendTraceOnFailedToGetRecordBeforeFinalizingRecord",1],[124,"event","OnAfterSuccessHandleRequest",0]]},{"name":"WaitForOthersWithSameCategory","line":161,"kind":"procedure","params":1,"steps":[[168,"event","OnBeforeWaitForOthersWithSameCategory",1]]},{"name":"CleanupCurrentUsersJobsWithSameCategory","line":198,"kind":"procedure","access":"local","params":1,"steps":[[219,"ext","table",472,"IsExpired",1],[220,"ext","table",472,"DeleteTask",0],[222,"call","Reschedule",1]]},{"name":"CleanupStaleJobs","line":226,"kind":"procedure","access":"local","params":0,"steps":[[247,"validate",472,"Run on Mondays"],[248,"validate",472,"Run on Tuesdays"],[249,"validate",472,"Run on Wednesdays"],[250,"validate",472,"Run on Thursdays"],[251,"validate",472,"Run on Fridays"],[252,"validate",472,"Run on Saturdays"],[253,"validate",472,"Run on Sundays"],[254,"validate",472,"Starting Time"],[255,"call","CalcInitialRunTime",2],[256,"run","codeunit",453],[259,"ext","table",472,"Restart",0],[262,"ext","table",472,"GetRecLockedExtendedTimeout",0],[263,"ext","table",472,"SetStatus",1],[264,"validate",472,"Starting Time"],[265,"call","CalcInitialRunTime",2],[266,"write",472,"Modify"],[267,"ext","table",472,"SetStatus",1]]},{"name":"Reschedule","line":277,"kind":"procedure","access":"local","params":1,"steps":[[280,"call","CalcInitialRunTime",2],[281,"event","OnRescheduleOnBeforeJobQueueEnqueue",0],[284,"write",472,"Modify"]]},{"name":"RescheduleAsWaiting","line":287,"kind":"procedure","access":"local","params":1,"steps":[[291,"event","OnRescheduleOnBeforeJobQueueEnqueue",0],[293,"event","OnRescheduleOnBeforeJobQueueEnqueueAsWaiting",0],[296,"write",472,"Modify"]]},{"name":"ActivateNextJobInCategory","line":299,"kind":"procedure","access":"internal","params":1,"steps":[[315,"write",472,"Modify"]]},{"name":"CalcNextRunTimeForRecurringJob","line":319,"kind":"procedure","params":2,"steps":[[325,"call","IsNextRecurringRunTimeCalculated",3],[328,"ext","table",472,"IsNextRunDateFormulaSet",0],[334,"call","AddMinutesToDateTime",2],[342,"event","OnCalcNextRunTimeForRecurringJobOnAfterCalcNewRunDateTime",1],[346,"call","CalcRunTimeForRecurringJob",2]]},{"name":"CalcNextRunTimeHoldDuetoInactivityJob","line":349,"kind":"procedure","params":2,"steps":[[353,"call","AddMinutesToDateTime",2],[354,"call","CalcRunTimeForRecurringJob",2]]},{"name":"CalcNextReadyStateMoment","line":357,"kind":"procedure","params":1,"steps":[[359,"call","AddMinutesToDateTime",2]]},{"name":"CalcInitialRunTime","line":362,"kind":"procedure","params":2,"steps":[[373,"event","OnCalcInitialRunTimeOnAfterCalcEarliestPossibleRunTime",1],[377,"ext","table",472,"IsNextRunDateFormulaSet",0],[378,"call","CalcRunTimeForRecurringJob",2]]},{"name":"CalcRunTimeForRecurringJob","line":383,"kind":"procedure","access":"local","params":2,"steps":[[401,"event","OnCalcRunTimeForRecurringJobOnAfterInitDays",0],[412,"ext","table",472,"GetStartingDateTime",1],[419,"event","OnCalcRunTimeForRecurringJob",0],[427,"ext","table",472,"GetStartingDateTime",1],[428,"ext","table",472,"GetEndingDateTime",1],[430,"ext","table",472,"GetStartingDateTime",1],[432,"ext","table",472,"GetStartingDateTime",1],[433,"ext","table",472,"GetStartingDateTime",1],[441,"event","OnAfterCalcRunTimeForRecurringJob",0]]},{"name":"IsNextRecurringRunTimeCalculated","line":444,"kind":"procedure","access":"local","params":3,"steps":[[446,"event","OnBeforeCalcNextRunTimeForRecurringJob",1]]},{"name":"SendTraceOnFailedToGetRecordBeforeFinalizingRecord","line":449,"kind":"procedure","access":"local","params":1,"steps":[[454,"ext","codeunit",53,"SetGlobalLanguageToDefault",0],[469,"ext","codeunit",53,"RestoreGlobalLanguage",0]]},{"name":"SendTraceOnFailedtoGetRecordBeforeUpdatingStatus","line":472,"kind":"procedure","access":"local","params":1,"steps":[[477,"ext","codeunit",53,"SetGlobalLanguageToDefault",0],[492,"ext","codeunit",53,"RestoreGlobalLanguage",0]]}]}