---
title: "Codeunit 3998 Retention Policy Scheduler, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/points/
object: https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/
app: "Base Application"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
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/"
---

# Codeunit 3998 Retention Policy Scheduler, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/points/

6 procedures and triggers with a step in src/Layers/W1/BaseApp/System/RetentionPolicy/RetentionPolicyScheduler.Codeunit.al, in source order, read from the text, not from a run.

## CheckRetentionPolicyScheduleOnAfterInsert

[Line 20](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L20), local.

- [24](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L24) calls `CanScheduleJobQueueEntry`
- [27](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L27) calls [Codeunit 3902 Retention Policy Setup](https://jonas-paprotka.de/ref/codeunit/3902-retention-policy-setup/) `IsRetentionPolicyEnabled`
- [28](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L28) calls `ScheduleRecurringRetentionPolicy`
- [30](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L30) calls `UnScheduleRecurringRetentionPolicy`

## CheckRetentionPolicyScheduleOnAfterModify

[Line 34](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L34), local.

- [38](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L38) calls `CanScheduleJobQueueEntry`
- [41](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L41) calls [Codeunit 3902 Retention Policy Setup](https://jonas-paprotka.de/ref/codeunit/3902-retention-policy-setup/) `IsRetentionPolicyEnabled`
- [42](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L42) calls `ScheduleRecurringRetentionPolicy`
- [44](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L44) calls `UnScheduleRecurringRetentionPolicy`

## CheckRetentionPolicyScheduleOnAfterDelete

[Line 48](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L48), local.

- [52](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L52) calls `CanScheduleJobQueueEntry`
- [55](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L55) calls [Codeunit 3902 Retention Policy Setup](https://jonas-paprotka.de/ref/codeunit/3902-retention-policy-setup/) `IsRetentionPolicyEnabled`
- [56](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L56) calls `UnScheduleRecurringRetentionPolicy`

## ScheduleRecurringRetentionPolicy

[Line 73](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L73), local.

- [82](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L82) calls [Table 472 Job Queue Entry](https://jonas-paprotka.de/ref/table/472-job-queue-entry/) `FindJobQueueEntry`
- [83](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L83) calls [Table 472 Job Queue Entry](https://jonas-paprotka.de/ref/table/472-job-queue-entry/) `IsReadyToStart`
- [86](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L86) calls [Table 472 Job Queue Entry](https://jonas-paprotka.de/ref/table/472-job-queue-entry/) `SetStatus`
- [87](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L87) calls [Codeunit 3908 Retention Policy Log](https://jonas-paprotka.de/ref/codeunit/3908-retention-policy-log/) `LogInfo`
- [89](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L89) calls `CreateRetentionPolicyJobQueueCategory`
- [90](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L90) calls `ScheduleOffset`
- [91](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L91) calls [Table 472 Job Queue Entry](https://jonas-paprotka.de/ref/table/472-job-queue-entry/) `ScheduleRecurrentJobQueueEntryWithRunDateFormula`
- [99](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L99) calls `JobTimeout`
- [100](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L100) calls [Codeunit 3908 Retention Policy Log](https://jonas-paprotka.de/ref/codeunit/3908-retention-policy-log/) `LogInfo`

## UnScheduleRecurringRetentionPolicy

[Line 115](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L115), local.

- [120](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L120) calls [Table 472 Job Queue Entry](https://jonas-paprotka.de/ref/table/472-job-queue-entry/) `FindJobQueueEntry`
- [123](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L123) calls [Table 472 Job Queue Entry](https://jonas-paprotka.de/ref/table/472-job-queue-entry/) `SetStatus`
- [124](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L124) calls [Codeunit 3908 Retention Policy Log](https://jonas-paprotka.de/ref/codeunit/3908-retention-policy-log/) `LogInfo`

## CreateRetentionPolicyJobQueueCategory

[Line 127](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L127), local.

- [136](https://jonas-paprotka.de/ref/codeunit/3998-retention-policy-scheduler/source/#L136) writes [Table 471 Job Queue Category](https://jonas-paprotka.de/ref/table/471-job-queue-category/) Insert

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
