---
id: object/table/3901
type: object
title: Table 3901 "Retention Policy Setup"
summary: Table 3901 "Retention Policy Setup" in System Application (System.DataAdministration). 11 fields. Present since at least BC23, still in BC30, changed in BC24-25, BC30.
tier: official
language: en
tags:
  - table
  - system application
versions:
  introduced: null
  last_changed: "30"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: cfe280afc76c17ec48ab9fcd55dec96d4796c19f388ee43be197e421cc396303
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Retention%20Policy/src/Retention%20Policy%20Setup/RetentionPolicySetup.Table.al
    title: src/System Application/App/Retention Policy/src/Retention Policy Setup/RetentionPolicySetup.Table.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn:
    - https://learn.microsoft.com/dynamics365/business-central/admin-data-retention-policies
  objects: []
  features: []
  topics:
    - topic/business-central/development-and-administration/administration-tasks-in-business-central/control-your-data
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/11262
object_type: table
object_id: 3901
name: Retention Policy Setup
namespace: System.DataAdministration
app: System Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "30"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 11
  procedures: 1
  events: 0
  subscribers: 0
relations:
  out: 1
  referenced_by: 0
  pages: 3
  extended_by: 0
  event_subscribers: 12
  calls: 1
  called_by: 0
  implements: 0
---

# Table 3901 "Retention Policy Setup"

> Table 3901 "Retention Policy Setup" in System Application (System.DataAdministration). 11 fields. Present since at least BC23, still in BC30, changed in BC24-25, BC30.

System Application · System.DataAdministration · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/System%20Application/App/Retention%20Policy/src/Retention%20Policy%20Setup/RetentionPolicySetup.Table.al) · facts from BC29

Learn documents this table through its pages: [Page 3901 "Retention Policy Setup Card"](../page/3901.md) (1 Learn page), [Page 3903 "Retention Policy Setup List"](../page/3903.md) (1).

## Fields

Explanation: the field's ToolTip in the code; without one, the ToolTip of a page control bound to the field (marked via the page); without that, its Caption (marked caption) when that differs from the name.

| No. | Name | Type | Explanation | Notes |
|---|---|---|---|---|
| 1 | Table Id | Integer | Specifies the ID of the table to which the retention policy applies. <small>via [Page 3901 "Retention Policy Setup Card"](../page/3901.md)</small> | TableRelation AllObjWithCaption."Object ID" where("Object Type" = const(Table)); NotBlank; DataClassification SystemMetadata |
| 2 | Table Name | Text[30] | Specifies the name of the table to which the retention policy applies. <small>via [Page 3901 "Retention Policy Setup Card"](../page/3901.md)</small> | FlowField: lookup(AllObjWithCaption."Object Name" where("Object Type" = const(Table), "Object ID" = field("Table Id"))); not editable |
| 3 | Table Caption | Text[249] | Specifies the caption of the table to which the retention policy applies. The caption is the translated, if applicable, name of the table. <small>via [Page 3901 "Retention Policy Setup Card"](../page/3901.md)</small> | FlowField: lookup(AllObjWithCaption."Object Caption" where("Object Type" = const(Table), "Object ID" = field("Table Id"))); not editable |
| 4 | Retention Period | Code[20] | Specifies an identifier for the retention period. <small>via [Page 3901 "Retention Policy Setup Card"](../page/3901.md)</small> | TableRelation [Table 3900 "Retention Period"](../table/3900.md) ("Retention Period".Code); DataClassification CustomerContent |
| 5 | Enabled | Boolean | Specifies whether the retention policy is enabled. <small>via [Page 3901 "Retention Policy Setup Card"](../page/3901.md)</small> | DataClassification SystemMetadata |
| 6 | Apply to all records | Boolean | Specifies whether the retention policy applies to all records in the table. If you want to specify criteria for the records to delete, this toggle must be turned off. <small>via [Page 3901 "Retention Policy Setup Card"](../page/3901.md)</small> | DataClassification SystemMetadata |
| 7 | Date Field No. | Integer | Specifies the number of the date or datetime field on the table used to determine the age of a record. <small>via [Page 3901 "Retention Policy Setup Card"](../page/3901.md)</small> | TableRelation Field."No." where(TableNo = field("Table ID"), "Type" = filter(Date \| DateTime)); DataClassification SystemMetadata |
| 8 | Date Field Name | Text[30] | Specifies the name of the date or datetime field on the table used to determine the age of a record. <small>via [Page 3901 "Retention Policy Setup Card"](../page/3901.md)</small> | FlowField: lookup(Field.FieldName where(TableNo = field("Table ID"), "No." = field("Date Field No."))); not editable |
| 9 | Date Field Caption | Text[80] | Specifies the caption of the date or datetime field on the table used to determine the age of a record. The caption is the translated name of the field. <small>via [Page 3901 "Retention Policy Setup Card"](../page/3901.md)</small> | FlowField: lookup(Field."Field Caption" where(TableNo = field("Table ID"), "No." = field("Date Field No."))); not editable |
| 10 | Manual | Boolean | Specifies whether the retention policy can only be run manually. <small>via [Page 3901 "Retention Policy Setup Card"](../page/3901.md)</small> | DataClassification SystemMetadata |
| 100 | Number Of Records Deleted | Integer | — | not editable; DataClassification SystemMetadata |

## Keys

- PrimaryKey: Table Id (clustered)

## Trigger event subscribers

- OnAfterDeleteEvent: [Codeunit 3912 "Reten. Policy Telemetry Impl."](../codeunit/3912.md) OnDeleteRetentionPolicySetup, [Codeunit 3912 "Reten. Policy Telemetry Impl."](../codeunit/3912.md) SendTelemetryOnAfterDelete, [Codeunit 3998 "Retention Policy Scheduler"](../codeunit/3998.md) CheckRetentionPolicyScheduleOnAfterDelete
- OnAfterInsertEvent: [Codeunit 3902 "Retention Policy Setup"](../codeunit/3902.md) InsertDefaultTableFiltersOnAfterInsertRetenPolSetup, [Codeunit 3912 "Reten. Policy Telemetry Impl."](../codeunit/3912.md) OnInsertRetentionPolicySetup, [Codeunit 3912 "Reten. Policy Telemetry Impl."](../codeunit/3912.md) SendTelemetryOnAfterInsert, [Codeunit 3998 "Retention Policy Scheduler"](../codeunit/3998.md) CheckRetentionPolicyScheduleOnAfterInsert
- OnAfterModifyEvent: [Codeunit 3912 "Reten. Policy Telemetry Impl."](../codeunit/3912.md) OnModifyRetentionPolicySetup, [Codeunit 3912 "Reten. Policy Telemetry Impl."](../codeunit/3912.md) SendTelemetryOnAfterModify, [Codeunit 3998 "Retention Policy Scheduler"](../codeunit/3998.md) CheckRetentionPolicyScheduleOnAfterModify
- OnBeforeInsertEvent: [Codeunit 3902 "Retention Policy Setup"](../codeunit/3902.md) VerifyRetentionPolicyAllowedTablesOnBeforeInsertRetenPolSetup
- OnBeforeRenameEvent: [Codeunit 3902 "Retention Policy Setup"](../codeunit/3902.md) ErrorOnBeforeRenameRetentionPolicySetup

## Procedures

1 local procedures, no public ones.

## Triggers

OnDelete, OnInsert

## Relations

- Retention Period: TableRelation [Table 3900 "Retention Period"](../table/3900.md)

## Pages and codeunits on this table

- [Page 3901 "Retention Policy Setup Card"](../page/3901.md) (source table)
- [Page 3903 "Retention Policy Setup List"](../page/3903.md) (source table)
- [Page 3905 "Reten. Policy Setup ListPart"](../page/3905.md) (source table)
- [Codeunit 3904 "Apply Retention Policy Impl."](../codeunit/3904.md) (codeunit runs on it)

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 3903 "Retention Policy Setup Impl."](../codeunit/3903.md) (1 call: `OnDelete → DeleteRetentionPolicySetup`)

## Recent changes

- 2026-09-23 [#11262 Fix retention policy deletion-limit stop propagation](../../changes/bcapps/11262.md) (main, BC30, fix)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-25, BC30

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "table", object_name: "Retention Policy Setup")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
