---
id: post/yzhums-com/69366
type: post
title: "Dynamics 365 Business Central: To automatically delete archived versions (For example, have 10 versions and want to keep a copy of the latest)"
summary: Business Central allows you to automatically delete archived versions of sales, purchase, and service documents using retention policies, while optionally keeping the most recent version. Retention policies help administrators manage data cleanup by deleting archived documents past their expiration date based on the most recent archived version's date.
tier: community
language: en
tags:
  - archiving
  - document management
  - retention policies
  - data cleanup
  - automation
system: sales
review:
  state: reviewed
  by: opus
  at: "2026-10-26T08:21:52.676Z"
  flags: []
generated:
  at: "2026-10-26T08:08:59.782Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 91d3459d6264d37ac45fcfc472d8897b2d6fb54972a849a9321da5b45bdbf9cd
evidence:
  - kind: blog
    url: https://yzhums.com/69366/
    title: "Dynamics 365 Business Central: To automatically delete archived versions (For example, have 10 versions and want to keep a copy of the latest)"
    date: "2026-01-07"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://yzhums.com/69366/
    title: "Dynamics 365 Business Central: To automatically delete archived versions (For example, have 10 versions and want to keep a copy of the latest)"
    date: "2026-01-07"
    commit: null
    t: null
    quote: If the original document isn't deleted, Business Central you can't delete the archived versions.
  - kind: blog
    url: https://yzhums.com/69366/
    title: "Dynamics 365 Business Central: To automatically delete archived versions (For example, have 10 versions and want to keep a copy of the latest)"
    date: "2026-01-07"
    commit: null
    t: null
    quote: When you set up the retention policy, you can specify that you want the policy to delete all archived versions except the most recent.
  - kind: blog
    url: https://yzhums.com/69366/
    title: "Dynamics 365 Business Central: To automatically delete archived versions (For example, have 10 versions and want to keep a copy of the latest)"
    date: "2026-01-07"
    commit: null
    t: null
    quote: Retention policies let administrators define how long they want to store data.
links:
  learn: []
  objects:
    - object/table/5107
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/shopify/troubleshoot
      title: Troubleshooting the Shopify and Business Central synchronization
      label: possibly related
      why: names Table 5107 "Sales Header Archive"
      by: code
post_id: "69366"
source_id: yzhums-com
source_name: Dynamics 365 Lab - Yun Zhu
url: https://yzhums.com/69366/
published_at: "2026-01-07T00:56:35.000Z"
author: Yun Zhu
full_text: false
words: 649
quotes:
  - text: If the original document isn't deleted, Business Central you can't delete the archived versions.
    why_it_matters: This is a critical constraint when setting up retention policies; original documents must be removed before archives can expire
  - text: When you set up the retention policy, you can specify that you want the policy to delete all archived versions except the most recent.
    why_it_matters: This capability directly addresses the user requirement to keep only the latest version while cleaning up historical archives
  - text: Retention policies let administrators define how long they want to store data.
    why_it_matters: Core feature that enables automated cleanup without manual intervention, reducing storage and maintaining compliance
code_objects_mentioned:
  - table Sales Header Archive
systems:
  - sales
  - purchasing
  - projects
versions_mentioned: []
cautions:
  - kind: gotcha
    quote: If the original document isn't deleted, Business Central you can't delete the archived versions.
    objects:
      - type: table
        name: Sales Header Archive
    events: []
    versions: []
preview:
  embeddable: true
  frame_url: null
  image: https://yzhums.com/wp-content/uploads/2026/01/Snipaste_2026-01-06_13-45-14.png
  image_alt: null
  image_w: null
  image_h: null
  site_name: Dynamics 365 Lab
  favicon: https://yzhums.com/wp-content/uploads/2020/08/cropped-logo-3-32x32.png
  probed_at: "2026-10-26T08:14:00.879Z"
---

# Dynamics 365 Business Central: To automatically delete archived versions (For example, have 10 versions and want to keep a copy of the latest)

[Read the post](https://yzhums.com/69366/) · Dynamics 365 Lab - Yun Zhu (Yun Zhu, MVP) · 2026-01-07 · 649 words · tier community · reviewed (checked by Opus)

> Business Central allows you to automatically delete archived versions of sales, purchase, and service documents using retention policies, while optionally keeping the most recent version. Retention policies help administrators manage data cleanup by deleting archived documents past their expiration date based on the most recent archived version's date.

## Key points

- Archive sales, purchase, service, and project documents automatically when documents are changed, deleted, printed, emailed, or posted
- Use retention policies to automatically delete old archived versions while keeping the most recent one
- Original documents must be deleted before their archived versions can expire; archived versions don't expire if the original still exists
- Specify retention periods and define which archive tables to include in cleanup policies from the setup page

## Quotes

- "If the original document isn't deleted, Business Central you can't delete the archived versions." (This is a critical constraint when setting up retention policies; original documents must be removed before archives can expire)
- "When you set up the retention policy, you can specify that you want the policy to delete all archived versions except the most recent." (This capability directly addresses the user requirement to keep only the latest version while cleaning up historical archives)
- "Retention policies let administrators define how long they want to store data." (Core feature that enables automated cleanup without manual intervention, reducing storage and maintaining compliance)

## AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

- [table 5107 "Sales Header Archive"](../../objects/table/5107.md)

## Possibly related

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

- [Troubleshooting the Shopify and Business Central synchronization](https://learn.microsoft.com/dynamics365/business-central/shopify/troubleshoot) — possibly related: names Table 5107 "Sales Header Archive"

## Heads up

- gotcha: "If the original document isn't deleted, Business Central you can't delete the archived versions." (about table Sales Header Archive)

## Context

- Features: Automatic document archiving, Retention policies, Manual archiving, Archive cleanup, Document restoration, Version management

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
