---
id: object/codeunit/5060
type: object
title: Codeunit 5060 "DuplicateManagement"
summary: Codeunit 5060 "DuplicateManagement" in Base Application (Microsoft.CRM.Duplicates). 8 public procedures, 7 events. Present since at least BC23, still in BC30, changed in BC24, BC26, BC28.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "28"
  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: ed3d041eeb8136b1b7818215b1f7fe6ecee99be6182f9403e8868e14a7b70ad2
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/CRM/Duplicates/DuplicateManagement.Codeunit.al
    title: src/Layers/W1/BaseApp/CRM/Duplicates/DuplicateManagement.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10050
object_type: codeunit
object_id: 5060
name: DuplicateManagement
namespace: Microsoft.CRM.Duplicates
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "26"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 17
  events: 7
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 1
  implements: 0
---

# Codeunit 5060 "DuplicateManagement"

> Codeunit 5060 "DuplicateManagement" in Base Application (Microsoft.CRM.Duplicates). 8 public procedures, 7 events. Present since at least BC23, still in BC30, changed in BC24, BC26, BC28.

Base Application · Microsoft.CRM.Duplicates · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/CRM/Duplicates/DuplicateManagement.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | tabledata "Marketing Setup" = r, tabledata "Contact Duplicate" = rid, tabledata "Cont. Duplicate Search String" = rid, tabledata "Duplicate Search String Setup" = r |

## Events published

- `OnBeforeRemoveContIndex(Contact: Record Contact; KeepAccepted: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeDuplicateExist(Contact: Record Contact; var Result: Boolean; var IsHandled: Boolean)` (integration)
- `OnInsDuplContIndexOnBeforeDuplContSearchStringInsert(var Contact: Record Contact; var DuplContSearchString: Record "Cont. Duplicate Search String"; DuplSearchStringSetup: Record "Duplicate Search String Setup")` (integration)
- `OnInsDuplContOnAfterDuplContSearchString2SetFilters(var DuplContSearchString: Record "Cont. Duplicate Search String"; var DuplContSearchString2: Record "Cont. Duplicate Search String")` (integration)
- `OnInsDuplContOnAfterDuplContSetFilters(var TempDuplCont: Record "Contact Duplicate" temporary; var DuplContSearchString: Record "Cont. Duplicate Search String"; var DuplSearchStringSetup: Record "Duplicate Search String Setup")` (integration)
- `OnMakeContIndex(var Contact: Record Contact; var IsHandled: Boolean)` (integration)
- `OnMakeContIndexOnBeforeInsDuplCont(var Contact: Record Contact; var IsHandled: Boolean)` (integration)

## Procedures

- `MakeContIndex(Cont: Record Contact)`
- `RemoveContIndex(Cont: Record Contact; KeepAccepted: Boolean)`
- `DuplicateExist(Cont: Record Contact): Boolean`
- `LaunchDuplicateForm(Cont: Record Contact)`
- `ComposeIndexString(var RecRef: RecordRef; FieldNo: Integer; Part: Option First,Last; ChrToCopy: Integer): Text[10]`
- `ComposeSearchString(var RecRef: RecordRef; FieldNo: Integer; StringPart: Enum "Duplicate Search String Part"; ChrToCopy: Integer): Text[10]`
- `Notify()`
- `RunModalContactDuplicates(Notification: Notification)`

Plus 2 local procedures.

## Triggers

OnRun

## 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.

- [Page 5134 "Contact Duplicates"](../page/5134.md) (2 calls: `LaunchDuplicateForm → (object)`, `RunModalContactDuplicates → (object)`)
- [Codeunit 1511 "Notification Lifecycle Mgt."](../codeunit/1511.md) (1 call: `Notify → SendNotification`)

## Called by

- [Table 5050 "Contact"](../table/5050.md) (5 calls: `CheckDuplicates → DuplicateExist`, `CheckDuplicates → LaunchDuplicateForm`, `CheckDuplicates → MakeContIndex`, …)

## Recent changes

- 2026-08-10 [#10050 Bug 638128: Deadlock in Duplicate Management when multiple users create customers at the same time](../../changes/bcapps/10050.md) (main, BC30, fix)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24, BC26, BC28

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: "codeunit", object_name: "DuplicateManagement")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
