---
id: change/bcapps/12429
type: change
title: "#12429 Skip enabling incomplete existing retention policies on install/upgrade"
summary: Skip enabling incomplete retention policies during install and upgrade when the existing setup would fail validation, preventing tenant upgrades from blocking on Dataverse Entity Change records with missing retention periods.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit reten. pol. install - baseapp
system: administration
review:
  state: reviewed
  by: opus
  at: "2026-10-19T01:10:56.721Z"
  flags: []
generated:
  at: "2026-11-25T00:13:20.045Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: baaa356163366c09e31f17d13c0a0045bb17ccbe
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12429
    title: "microsoft/BCApps#12429: Skip enabling incomplete existing retention policies on install/upgrade"
    date: "2026-10-08"
    commit: baaa356163366c09e31f17d13c0a0045bb17ccbe
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/3999
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/admin-data-retention-policies
      title: Clean up data with retention policies
      label: possibly related
      why: Documents retention policy setup and enabling behavior during installation and upgrades.
      by: model
number: 12429
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12429
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-08T14:43:00Z"
author: darjoo
author_type: User
community_contribution: false
labels:
  - "Team: Integrations"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 95
  deletions: 2
  al: 1
apps:
  - Base Application
objects_touched:
  - key: codeunit/3999
    page: codeunit/3999
    type: codeunit
    id: 3999
    name: Reten. Pol. Install - BaseApp
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 653144
systems:
  - administration
quote: null
joined_against:
  major: "30"
  commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
---

# #12429 Skip enabling incomplete existing retention policies on install/upgrade

> Skip enabling incomplete retention policies during install and upgrade when the existing setup would fail validation, preventing tenant upgrades from blocking on Dataverse Entity Change records with missing retention periods.

[Pull request](https://github.com/microsoft/BCApps/pull/12429) · merged into `main` (BC30) on 2026-10-08 by darjoo · 2 files (+95 -2), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Guard skips enabling retention policy when record is already enabled, applies to all records without a retention period, or uses filters with no enabled lines
- Preserves customer's existing incomplete setup instead of blocking upgrade with validation error
- Added read permission on Retention Policy Setup Line to codeunit 3999
- Changed EnableRetentionPolicySetup from local to internal visibility for testing
- Covers Dataverse Entity Change, Integration Synch. Job and Integration Synch. Job Errors tables
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 3999 "Reten. Pol. Install - BaseApp"](../../objects/codeunit/3999.md), Base Application: modified

## Context

- Work items: AB#653144
- Labels: Team: Integrations
- Systems: administration

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Clean up data with retention policies](https://learn.microsoft.com/dynamics365/business-central/admin-data-retention-policies) — possibly related: Documents retention policy setup and enabling behavior during installation and upgrades. (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
