---
id: object/codeunit/100
type: object
title: Codeunit 100 "Calc. G/L Acc. Where-Used"
summary: Codeunit 100 "Calc. G/L Acc. Where-Used" in Base Application (Microsoft.Finance.GeneralLedger.Account). 6 public procedures, 6 events. Present since at least BC23, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  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: 019b799636110aeac08efeb2ad8ab017e5dbc8384a542d13a8bcc4b2e7e2387e
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Finance/GeneralLedger/Account/CalcGLAccWhereUsed.Codeunit.al
    title: src/Layers/W1/BaseApp/Finance/GeneralLedger/Account/CalcGLAccWhereUsed.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: 100
name: Calc. G/L Acc. Where-Used
namespace: Microsoft.Finance.GeneralLedger.Account
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 20
  events: 6
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 6
  calls: 7
  called_by: 2
  implements: 0
---

# Codeunit 100 "Calc. G/L Acc. Where-Used"

> Codeunit 100 "Calc. G/L Acc. Where-Used" in Base Application (Microsoft.Finance.GeneralLedger.Account). 6 public procedures, 6 events. Present since at least BC23, still in BC30.

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

## Events published

- `OnShowExtensionPage(GLAccountWhereUsed: Record "G/L Account Where-Used")` (integration): Integration event raised to allow extensions to handle custom setup page navigation. Enables custom object types to be included in the where-used analysis with specialized page handling.
  - subscribers: [Codeunit 18 "Financial Report Mgt."](../codeunit/18.md) OnShowExtensionPage, [Codeunit 5958 "Serv. Calc. G/L Acc.Where-Used"](../codeunit/5958.md) OnShowExtensionPage, [Codeunit 6789 "Withholding Tax Event Handler"](../codeunit/6789.md) OnShowExtensionPage
- `OnAfterCheckPostingGroups(var TempGLAccountWhereUsed: Record "G/L Account Where-Used" temporary; GLAccNo: Code[20])` (integration): Integration event raised after completing posting group analysis for a G/L account. Allows extensions to add custom table checks or modify the where-used results before display.
  - subscribers: [Codeunit 18 "Financial Report Mgt."](../codeunit/18.md) OnAfterCheckPostingGroups
- `OnAfterFillTableBuffer(var TableBuffer: Record "Integer")` (integration): Integration event raised after building the list of tables to check for G/L account usage. Enables extensions to add custom tables to the where-used analysis scope.
  - subscribers: [Codeunit 5958 "Serv. Calc. G/L Acc.Where-Used"](../codeunit/5958.md) OnAfterFillTableBuffer, [Codeunit 6789 "Withholding Tax Event Handler"](../codeunit/6789.md) OnAfterFillTableBuffer
- `OnBeforeShowGLAccWhereUsed(var GLAccountWhereUsed: Record "G/L Account Where-Used")` (integration): Integration event raised before displaying the where-used list to the user. Allows extensions to filter or modify the results before presentation.
- `OnShowSetupFormOnBeforeFAAllocationRunPage(var FAAllocation: Record "FA Allocation"; var GLAccountWhereUsed: Record "G/L Account Where-Used")` (integration): Integration event raised before opening the FA Allocation page from where-used navigation. Enables extensions to customize FA allocation page behavior or apply additional filters.
- `OnDeleteGLNoOnBeforeTempGLAccWhereUsedFindFirst(var TempGLAccountWhereUsed: Record "G/L Account Where-Used" temporary)` (integration): Integration event raised before checking if where-used entries exist during G/L account deletion validation. Allows extensions to perform custom where-used checks or modify validation logic.

## Procedures

- `ShowSetupForm(GLAccWhereUsed: Record "G/L Account Where-Used")`: Opens the appropriate setup form for the table referenced in the where-used entry. Navigates directly to the configuration page where the G/L account is being used.
- `DeleteGLNo(GLAccNo: Code[20]): Boolean`: Validates if a G/L account can be deleted by checking for usage in setup tables. Displays where-used information if account is referenced, preventing deletion.
- `CheckGLAcc(GLAccNo: Code[20])`: Analyzes where a G/L account is used and displays the results in the where-used list. Provides comprehensive analysis of account dependencies across all setup tables.
- `InsertGroupForRecord(var TempGLAccountWhereUsed: Record "G/L Account Where-Used" temporary; TableID: Integer; TableCaption: Text[80]; GLAccNo: Code[20]; GLAccNo2: Code[20]; FieldCaption: Text[80]; Key: array[8] of Text[80])`: Inserts a where-used entry group for a specific record using table metadata. Creates standardized entries for account usage tracking with table and field information.
- `CheckPostingGroups(GLAccNo: Code[20])`: Performs comprehensive analysis of posting group tables to identify where a G/L account is used. Scans all relevant setup tables using metadata relationships to build complete usage report.
- `AddTable(var TableBuffer: Record "Integer"; TableID: Integer)`: Adds a table to the buffer of tables to be checked for G/L account usage. Prevents duplicate entries when building the list of tables to analyze.

Plus 8 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.

- [Codeunit 27 "Confirm Management"](../codeunit/27.md) (1 call: `DeleteGLNo → GetResponse`)
- [Page 101 "General Journal Templates"](../page/101.md) (1 call: `ShowSetupForm → (object)`)
- [Page 284 "Allocations"](../page/284.md) (1 call: `ShowSetupForm → (object)`)
- [Page 459 "Sales & Receivables Setup"](../page/459.md) (1 call: `ShowSetupForm → (object)`)
- [Page 460 "Purchases & Payables Setup"](../page/460.md) (1 call: `ShowSetupForm → (object)`)
- [Page 5612 "FA Posting Group Card"](../page/5612.md) (1 call: `ShowSetupForm → (object)`)
- [Page 5826 "Inventory Posting Setup"](../page/5826.md) (1 call: `ShowSetupForm → (object)`)

## Called by

- [Codeunit 361 "MoveEntries"](../codeunit/361.md) (1 call: `MoveGLEntries → DeleteGLNo`)
- [Codeunit 6789 "Withholding Tax Event Handler"](../codeunit/6789.md) (1 call: `AddCountryTables → AddTable`)

## Across versions

- Present in: BC23-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: "Calc. G/L Acc. Where-Used")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
