---
id: object/codeunit/7250
type: object
title: Codeunit 7250 "Bank Rec. AI Matching Impl."
summary: Codeunit 7250 "Bank Rec. AI Matching Impl." in BankAccRecWithAI (Microsoft.Bank.Reconciliation). 22 public procedures, 3 event subscribers. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - bankaccrecwithai
versions:
  introduced: "29"
  last_changed: null
  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: 3445bedd11ed1bd718c7e5baeb87debf98e00f84068da2a6aa46747ed8472b0d
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/BankAccRecWithAI/app/src/BankRecAIMatchingImpl.Codeunit.al
    title: src/Apps/W1/BankAccRecWithAI/app/src/BankRecAIMatchingImpl.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/10090
object_type: codeunit
object_id: 7250
name: Bank Rec. AI Matching Impl.
namespace: Microsoft.Bank.Reconciliation
app: BankAccRecWithAI
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 29
  events: 0
  subscribers: 3
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 8
  called_by: 7
  implements: 0
---

# Codeunit 7250 "Bank Rec. AI Matching Impl."

> Codeunit 7250 "Bank Rec. AI Matching Impl." in BankAccRecWithAI (Microsoft.Bank.Reconciliation). 22 public procedures, 3 event subscribers. Introduced in BC29, still in BC30.

BankAccRecWithAI · Microsoft.Bank.Reconciliation · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/BankAccRecWithAI/app/src/BankRecAIMatchingImpl.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Access | Internal |

## Event subscriptions

- HandleOnFindBestMatches subscribes to Codeunit "Match Bank Rec. Lines" OnFindBestMatches
- HandleOnRegisterCopilotCapability subscribes to Page "Copilot AI Capabilities" OnRegisterCopilotCapability
- RegisterPerCompanyTags subscribes to Codeunit "Upgrade Tag" OnGetPerCompanyUpgradeTags

## Procedures

- `BuildBankRecCompletionTask(IncludeFewShotExample: Boolean): SecretText`
- `AddCompletionPromptLine(Completion: SecretText; NewPromptLine: Text): SecretText` (internal)
- `BuildBankRecCompletionPrompt(TaskPrompt: SecretText; StatementLines: Text; LedgerLines: Text): SecretText`
- `BuildBankRecCompletionPromptUserMessage(StatementLines: Text; LedgerLines: Text): SecretText`
- `BuildBankRecLedgerEntries(var LedgerLines: Text; var TempBankAccLedgerEntryMatchingBuffer: Record "Ledger Entry Matching Buffer" temporary; var CandidateLedgerEntryNos: List of [Integer]): Text`
- `BuildBankRecStatementLines(var StatementLines: Text; var BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line"): Text`
- `RemoveShortWords(Text: Text[250]): Text[250]`
- `ComputeStringNearness(String1: Text[250]; String2: Text[250]): Decimal`
- `PromptSizeThreshold(): Integer`
- `LedgerEntryInputThreshold(): Integer`
- `MaxTokens(): Integer`
- `GetAzureKeyVaultSecret(var SecretValue: SecretText; SecretName: Text): Boolean` (internal)
- `BuildLedgerEntriesFilter(TopLedgerEntries: array[5] of Record "Ledger Entry Matching Buffer"; TopSimilarityScore: array[5] of Decimal): Text`
- `CreateCompletionAndMatch(CompletionTaskTxt: SecretText; var BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line"; var TempBankAccLedgerEntryMatchingBuffer: Record "Ledger Entry Matching Buffer" temporary; var TempBankStatementMatchingBuffer: Record "Bank Statement Matching Buffer" temporary; DaysTolerance: Integer): Integer`
- `CreateCompletionAndMatch(CompletionTaskTxt: SecretText; UserMessageTxt: SecretText; var BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line"; var TempBankAccLedgerEntryMatchingBuffer: Record "Ledger Entry Matching Buffer" temporary; var TempBankStatementMatchingBuffer: Record "Bank Statement Matching Buffer" temporary; DaysTolerance: Integer): Integer`
- `ProcessCompletionAnswer(var CompletionAnswerTxt: Text; var BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line"; var TempBankAccLedgerEntryMatchingBuffer: Record "Ledger Entry Matching Buffer" temporary; var TempBankStatementMatchingBuffer: Record "Bank Statement Matching Buffer" temporary; var NumberOfFoundMatches: Integer)`
- `GenerateMatchProposals(var TempBankAccRecAIProposal: Record "Bank Acc. Rec. AI Proposal" temporary; var BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line"; var TempBankAccLedgerEntryMatchingBuffer: Record "Ledger Entry Matching Buffer" temporary; var TempBankStatementMatchingBuffer: Record "Bank Statement Matching Buffer" temporary; DaysTolerance: Integer)`
- `HasReservedWords(Input: Text): Boolean`
- `ApplyToProposedLedgerEntries(var TempBankAccRecAIProposal: Record "Bank Acc. Rec. AI Proposal" temporary; var TempBankStatementMatchingBuffer: Record "Bank Statement Matching Buffer" temporary): Integer`
- `FeatureName(): Text`
- `RegisterCapability()`
- `FoundInputWithReservedWords(): Boolean`

Plus 4 local procedures.

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

- [Codeunit 7773 "Copilot Capability"](../codeunit/7773.md) (3 calls: `RegisterCapability → IsCapabilityRegistered`, `RegisterCapability → ModifyCapability`, `RegisterCapability → RegisterCapability`)
- [Codeunit 1252 "Match Bank Rec. Lines"](../codeunit/1252.md) (2 calls: `ApplyToProposedLedgerEntries → SaveManyToOneMatching`, `ApplyToProposedLedgerEntries → SaveOneToOneMatching`)
- [Codeunit 7759 "AOAI Token"](../codeunit/7759.md) (2 calls: `FindDateFilterOnLedgerEntryBuffer → GetGPT4TokenCount`, `GenerateMatchProposals → GetGPT4TokenCount`)
- [Codeunit 8703 "Feature Telemetry"](../codeunit/8703.md) (2 calls: `GenerateMatchProposals → LogUptake`, `GenerateMatchProposals → LogUsage`)
- [Codeunit 9999 "Upgrade Tag"](../codeunit/9999.md) (2 calls: `RegisterCapability → HasUpgradeTag`, `RegisterCapability → SetUpgradeTag`)
- [Codeunit 1251 "Record Match Mgt."](../codeunit/1251.md) (1 call: `ComputeStringNearness → CalculateStringNearness`)
- [Codeunit 2200 "Azure Key Vault"](../codeunit/2200.md) (1 call: `GetAzureKeyVaultSecret → GetAzureKeyVaultSecret`)
- [Codeunit 457 "Environment Information"](../codeunit/457.md) (1 call: `RegisterCapability → IsSaaSInfrastructure`)

## Called by

- [Page 7250 "Bank Acc. Rec. AI Proposal"](../page/7250.md) (9 calls: `ApplyToProposedLedgerEntries → ApplyToProposedLedgerEntries`, `ApplyToProposedLedgerEntries → FeatureName`, `AutoMatchWithCopilot → FeatureName`, …)
- [Codeunit 7251 "Bank Acc. Rec. Trans. to Acc."](../codeunit/7251.md) (7 calls: `BuildBankRecStatementLines → HasReservedWords`, `BuildGLAccounts → HasReservedWords`, `BuildMostAppropriateGLAccountPromptTask → AddCompletionPromptLine`, …)
- [Page 7252 "Trans. To GL Acc. AI Proposal"](../page/7252.md) (3 calls: `GenerateTransferToGLAccountProposals → FeatureName`, `OnQueryClosePage → FeatureName`, `PostNewPaymentsToProposedGLAccounts → FeatureName`)
- [Page 7251 "Bank Acc. Rec. AI Proposal Sub"](../page/7251.md) (2 calls: `OpenProposedRecord → FeatureName`, `SaveToTextToAccountMapping → FeatureName`)
- [Codeunit 7252 "Bank Acc. Rec. AI Install"](../codeunit/7252.md) (1 call: `OnInstallAppPerDatabase → RegisterCapability`)
- [Page extension 7253 "BankAccReconciliationExt"](../pageextension/7253.md) (1 call: `OnOpenPage → RegisterCapability`)
- [Page extension 7254 "BankAccReconciliationListExt"](../pageextension/7254.md) (1 call: `OnOpenPage → RegisterCapability`)

## Recent changes

- 2026-08-11 [#10090 [Bank Acc. Reconciliation with Copilot] Read the functional part of the prompt from .resources and safety clause from Key Vault](../../changes/bcapps/10090.md) (main, BC30, refactor)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

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: "Bank Rec. AI Matching Impl.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
