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

# Codeunit 1251 "Record Match Mgt."

> Codeunit 1251 "Record Match Mgt." in Base Application (Microsoft.Bank.Reconciliation). 4 public procedures. Present since at least BC23, still in BC30, changed in BC25.

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

## Procedures

- `GetLongestCommonSubstring(FirstString: Text; SecondString: Text): Text`: Finds and returns the longest common substring between two strings. Performs case-insensitive comparison to identify the longest sequence of characters that appears in both input strings. Used as a foundation for text similarity scoring in payment matching algorithms.
- `CalculateStringNearness(FirstString: Text; SecondString: Text; Threshold: Integer; NormalizingFactor: Integer): Integer`: Computes a nearness score between strings. Nearness is based on repeatedly finding longest common substrings. Substring matches below Threshold are not considered. Normalizing factor is the max value returned by this procedure.
- `CalculateExactStringNearness(ComparingString: Text; BaseString: Text; NormalizingFactor: Integer): Integer`: Like CalculateStringNearness, however it doesn't repeatedly takes substrings, only once. The result is normalized with respect to the length of the BaseString, in contrast with CalculateStringNearness where it was normalized with respect ot the shorter one.
- `Trim(InputString: Text): Text`: Removes leading and trailing whitespace characters from a string. Provides consistent text normalization for string comparison operations, ensuring that whitespace differences do not affect matching accuracy.

Plus 2 local procedures.

## Triggers

OnRun

## Called by

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 1255 "Match Bank Payments"](../codeunit/1255.md) (5 calls: `FindBankAccLedgerEntry → CalculateStringNearness`, `FindBankAccLedgerEntry → Trim`, `GetStringNearness → CalculateStringNearness`, …)
- [Codeunit 1250 "Match General Journal Lines"](../codeunit/1250.md) (4 calls: `GetAccountMapping → CalculateStringNearness`, `GetAccountMapping → Trim`, `GetDescriptionMatchScore → CalculateStringNearness`, …)
- [Codeunit 1252 "Match Bank Rec. Lines"](../codeunit/1252.md) (4 calls: `BankReconciliationLineTextSimilarityScores → CalculateExactStringNearness`, `BankReconciliationLineTextSimilarityScores → CalculateStringNearness`, `GetDescriptionMatchScore → CalculateStringNearness`, …)
- [Codeunit 1217 "Pre-map Incoming Purch. Doc"](../codeunit/1217.md) (3 calls: `FindVendorByNameAndAddress → CalculateStringNearness`, `FindVendorByPhoneNo → CalculateStringNearness`, `ValidateCompanyInfoByNameAndAddress → CalculateStringNearness`)
- [Table 1251 "Text-to-Account Mapping"](../table/1251.md) (2 calls: `InsertRec → Trim`, `InsertRecFromBankAccReconciliationLine → Trim`)
- [Codeunit 7250 "Bank Rec. AI Matching Impl."](../codeunit/7250.md) (1 call: `ComputeStringNearness → CalculateStringNearness`)
- [Codeunit 7251 "Bank Acc. Rec. Trans. to Acc."](../codeunit/7251.md) (1 call: `GetMostAppropriateGLAccountNos → Trim`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC25

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: "Record Match Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
