---
id: post/yzhums-com/66463
type: post
title: "Dynamics 365 Business Central: How to prevent users from uploading duplicate files as attachments (Duplicate file names)"
summary: Preventing duplicate file attachments in Business Central requires customization because the standard allows the same file to be uploaded multiple times. The post demonstrates a solution using a table extension to add a setting and an event subscriber to block duplicate file names based on configuration.
tier: community
language: en
tags:
  - attachments
  - documents
  - duplicate prevention
  - customization
  - factbox
system: administration
review:
  state: reviewed
  by: opus
  at: "2026-10-26T06:42:31.467Z"
  flags: []
generated:
  at: "2026-10-26T05:51:10.938Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 171b428220144c642f556d6d0eb9d4061e13b139afb35535022b77c2dc7aeafb
evidence:
  - kind: blog
    url: https://yzhums.com/66463/
    title: "Dynamics 365 Business Central: How to prevent users from uploading duplicate files as attachments (Duplicate file names)"
    date: "2025-08-07"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://yzhums.com/66463/
    title: "Dynamics 365 Business Central: How to prevent users from uploading duplicate files as attachments (Duplicate file names)"
    date: "2025-08-07"
    commit: null
    t: null
    quote: In the standard Business Central, it is allowed to upload the same file multiple times, which means duplicate files.
  - kind: blog
    url: https://yzhums.com/66463/
    title: "Dynamics 365 Business Central: How to prevent users from uploading duplicate files as attachments (Duplicate file names)"
    date: "2025-08-07"
    commit: null
    t: null
    quote: There is no Allow Duplicate FileName setting in the BC, and there is no event to force the value of this variable.
  - kind: blog
    url: https://yzhums.com/66463/
    title: "Dynamics 365 Business Central: How to prevent users from uploading duplicate files as attachments (Duplicate file names)"
    date: "2025-08-07"
    commit: null
    t: null
    quote: So this can't be done in the standard, and requires some simple customization.
links:
  learn: []
  objects:
    - object/table/1173
    - object/table/98
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  related:
    - to: post/olofsimren-com/3853
      title: Allow Posting Date Formula
      label: possibly related
      why: both name Table 98 "General Ledger Setup"
      by: code
    - to: post/mohana-blog/tag-blogger-com-1999-blog-1492436440038408053-post-8913658799123411419--5a782b6899
      title: "Allow Posting From/To DateFormula: No More Monthly Date Updates from Business Central v28"
      label: possibly related
      why: both name Table 98 "General Ledger Setup"
      by: code
    - to: post/sauravdhyani-com/tag-blogger-com-1999-blog-3122193036149030463-post-6476700913383925526--f5fa15da26
      title: Automating Posting Periods in Business Central with Date Formulas
      label: possibly related
      why: both name Table 98 "General Ledger Setup"
      by: code
    - to: post/yzhums-com/71463
      title: "Business Central 2026 release wave 1 (BC28): Calculate withholding taxes for vendors (Withholding Tax)"
      label: possibly related
      why: both name Table 98 "General Ledger Setup"
      by: code
    - to: video/VIda0Ok1SSQ
      title: Control Deferral Posting
      label: possibly related
      why: both name Table 98 "General Ledger Setup"
      by: code
    - to: post/yzhums-com/64609
      title: "Dynamics 365 Business Central: “Hide Company Bank Account” setup in General Ledger Setup (Update Company Bank Account on posted documents)"
      label: possibly related
      why: both name Table 98 "General Ledger Setup"
      by: code
    - to: post/yzhums-com/64042
      title: "Dynamics 365 Business Central: Convert Word (.docx) To HTML (.html) within BC (No control add-in and APIs)"
      label: possibly related
      why: both name Table 1173 "Document Attachment"
      by: code
    - to: post/yzhums-com/68624
      title: "Dynamics 365 Business Central: How to get the page number of a PDF or Word file in AL (Display the page count on Attached Documents and Doc. Attachment List Factbox)"
      label: possibly related
      why: both name Table 1173 "Document Attachment"
      by: code
    - to: post/sauravdhyani-com/tag-blogger-com-1999-blog-3122193036149030463-post-4662412510469862425--2edabbcaf9
      title: How to Use Date Formulas for Allowed Posting Periods in Business Central BC28.
      label: possibly related
      why: both name Table 98 "General Ledger Setup"
      by: code
    - to: post/gerardorenteria-blog/11203
      title: New Application Ideas of Dynamics 365 Business Central (2025 MAY)
      label: possibly related
      why: both name Table 1173 "Document Attachment"
      by: code
post_id: "66463"
source_id: yzhums-com
source_name: Dynamics 365 Lab - Yun Zhu
url: https://yzhums.com/66463/
published_at: "2025-08-07T01:14:19.000Z"
author: Yun Zhu
full_text: false
words: 469
quotes:
  - text: In the standard Business Central, it is allowed to upload the same file multiple times, which means duplicate files.
    why_it_matters: Identifies the core problem that needs to be solved
  - text: There is no Allow Duplicate FileName setting in the BC, and there is no event to force the value of this variable.
    why_it_matters: Explains why standard configuration alone cannot solve this problem
  - text: So this can't be done in the standard, and requires some simple customization.
    why_it_matters: Clarifies that a code-based solution is necessary
code_objects_mentioned:
  - table Document Attachment
  - table General Ledger Setup
systems:
  - administration
versions_mentioned:
  - Business Central 2024 wave 2
  - BC25
preview:
  embeddable: true
  frame_url: null
  image: https://yzhums.com/wp-content/uploads/2025/08/Snipaste_2025-08-06_15-41-40.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-26T06:16:56.521Z"
---

# Dynamics 365 Business Central: How to prevent users from uploading duplicate files as attachments (Duplicate file names)

[Read the post](https://yzhums.com/66463/) · Dynamics 365 Lab - Yun Zhu (Yun Zhu, MVP) · 2025-08-07 · 469 words · tier community · reviewed (checked by Opus)

> Preventing duplicate file attachments in Business Central requires customization because the standard allows the same file to be uploaded multiple times. The post demonstrates a solution using a table extension to add a setting and an event subscriber to block duplicate file names based on configuration.

## Key points

- Standard Business Central allows uploading duplicate files with the same name to attachments
- The AllowDuplicateFileName variable in table 1173 Document Attachment controls this behavior but has no UI setting
- No standard event forces this value, so customization is needed
- Solution uses a table extension to General Ledger Setup plus an event subscriber on OnInsertAttachmentOnBeforeImportStream

## Quotes

- "In the standard Business Central, it is allowed to upload the same file multiple times, which means duplicate files." (Identifies the core problem that needs to be solved)
- "There is no Allow Duplicate FileName setting in the BC, and there is no event to force the value of this variable." (Explains why standard configuration alone cannot solve this problem)
- "So this can't be done in the standard, and requires some simple customization." (Clarifies that a code-based solution is necessary)

## 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 1173 "Document Attachment"](../../objects/table/1173.md)
- [table 98 "General Ledger Setup"](../../objects/table/98.md)

## Possibly related

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

- [Allow Posting Date Formula](../../posts/olofsimren-com/3853.md) — possibly related: both name Table 98 "General Ledger Setup"
- [Allow Posting From/To DateFormula: No More Monthly Date Updates from Business Central v28](../../posts/mohana-blog/tag-blogger-com-1999-blog-1492436440038408053-post-8913658799123411419--5a782b6899.md) — possibly related: both name Table 98 "General Ledger Setup"
- [Automating Posting Periods in Business Central with Date Formulas](../../posts/sauravdhyani-com/tag-blogger-com-1999-blog-3122193036149030463-post-6476700913383925526--f5fa15da26.md) — possibly related: both name Table 98 "General Ledger Setup"
- [Business Central 2026 release wave 1 (BC28): Calculate withholding taxes for vendors (Withholding Tax)](../../posts/yzhums-com/71463.md) — possibly related: both name Table 98 "General Ledger Setup"
- [Control Deferral Posting](../../videos/VIda0Ok1SSQ.md) — possibly related: both name Table 98 "General Ledger Setup"
- [Dynamics 365 Business Central: “Hide Company Bank Account” setup in General Ledger Setup (Update Company Bank Account on posted documents)](../../posts/yzhums-com/64609.md) — possibly related: both name Table 98 "General Ledger Setup"
- [Dynamics 365 Business Central: Convert Word (.docx) To HTML (.html) within BC (No control add-in and APIs)](../../posts/yzhums-com/64042.md) — possibly related: both name Table 1173 "Document Attachment"
- [Dynamics 365 Business Central: How to get the page number of a PDF or Word file in AL (Display the page count on Attached Documents and Doc. Attachment List Factbox)](../../posts/yzhums-com/68624.md) — possibly related: both name Table 1173 "Document Attachment"
- [How to Use Date Formulas for Allowed Posting Periods in Business Central BC28.](../../posts/sauravdhyani-com/tag-blogger-com-1999-blog-3122193036149030463-post-4662412510469862425--2edabbcaf9.md) — possibly related: both name Table 98 "General Ledger Setup"
- [New Application Ideas of Dynamics 365 Business Central (2025 MAY)](../../posts/gerardorenteria-blog/11203.md) — possibly related: both name Table 1173 "Document Attachment"

## Context

- Features: file attachments, duplicate file detection, document attachment management, drag and drop upload
- Versions: Business Central 2024 wave 2, BC25

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.
