---
id: object/codeunit/570
type: object
title: Codeunit 570 "G/L Account Category Mgt."
summary: Codeunit 570 "G/L Account Category Mgt." in Base Application (Microsoft.Finance.GeneralLedger.Account). 57 public procedures, 7 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in 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: 4391a2d55118196b8dae211c4aa9884d7176fa561215d3c22e05d28b4f13e3af
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Finance/GeneralLedger/Account/GLAccountCategoryMgt.Codeunit.al
    title: src/Layers/W1/BaseApp/Finance/GeneralLedger/Account/GLAccountCategoryMgt.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: 570
name: G/L Account Category Mgt.
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:
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 76
  events: 7
  subscribers: 1
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 2
  called_by: 17
  implements: 0
---

# Codeunit 570 "G/L Account Category Mgt."

> Codeunit 570 "G/L Account Category Mgt." in Base Application (Microsoft.Finance.GeneralLedger.Account). 57 public procedures, 7 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC28.

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/GLAccountCategoryMgt.Codeunit.al) · facts from BC29

## Events published

- `OnAfterInitializeCompany()` (integration): Integration event raised after company initialization is complete. Allows subscribers to perform custom setup or validation after standard account categories are created.
- `OnBeforeInitializeCompany()` (integration): Integration event raised before company initialization begins. Allows subscribers to perform custom setup or preparation before standard account categories are created.
- `OnBeforeOnRunAccountScheduleReport(AccSchedName: Code[10]; var IsHandled: Boolean)` (integration): Integration event raised before running an account schedule report. Allows subscribers to customize or override the standard account schedule execution.
- `OnBeforeInitializeAccountCategories(var IsHandled: Boolean)` (integration): Integration event raised before initializing standard account categories. Allows subscribers to customize or override the standard account category initialization process.
- `OnBeforeCheckGLAccount(TableNo: Integer; FieldNo: Integer; AccNo: Code[20]; CheckProdPostingGroup: Boolean; CheckDirectPosting: Boolean; var AccountCategory: Option; var AccountSubcategory: Text; var IsHandled: Boolean)` (integration): Integration event raised before validating and categorizing a G/L account. Allows subscribers to customize account validation logic or override category assignment.
- `OnBeforeLookupGLAccount(TableNo: Integer; FieldNo: Integer; var AccountNo: Code[20]; var AccountCategory: Option; var AccountSubcategoryFilter: Text; var IsHandled: Boolean)` (integration): Integration event raised before opening G/L account lookup with category filtering. Allows subscribers to customize lookup behavior or override filtering criteria.
- `OnAfterInitializeAccountCategories()` (integration): Integration event raised after account categories have been initialized. Allows subscribers to perform additional setup or customization after standard categories are created.

## Event subscriptions

- OnInitializeCompany subscribes to Codeunit "Company-Initialize" OnCompanyInitialize

## Procedures

- `InitializeAccountCategories()`: Creates the complete hierarchy of standard G/L account categories and subcategories for financial reporting. Initializes categories for Assets, Liabilities, Equity, Income, and Cost of Goods Sold with detailed subcategories.
- `AddCategory(InsertAfterEntryNo: Integer; ParentEntryNo: Integer; AccountCategory: Option; NewDescription: Text[80]; SystemGenerated: Boolean; CashFlowActivity: Option): Integer`: Creates a new general ledger account category with specified hierarchical position and properties. Inserts the category at the specified position in the category tree and updates presentation order.
- `ForceInitializeStandardAccountSchedules()`: Forces recreation of standard account schedules even if they already exist. Used when account schedules need to be reset or updated with new standard definitions.
- `InitializeStandardAccountSchedules()`: Creates standard financial report structures including Balance Sheet, Income Statement, Cash Flow, and Retained Earnings. Generates account schedules and column layouts based on account categories for automated financial reporting.
- `GetGLSetup(var GeneralLedgerSetup: Record "General Ledger Setup")`: Retrieves General Ledger Setup with validation that required financial reports are configured. Automatically initializes missing financial reports and triggers account schedule generation if needed.
- `RunAccountScheduleReport(FinancialReportName: Code[10])`: Executes the account schedule report for the specified financial report configuration. Opens the Account Schedule report with predefined filters and formatting based on the financial report setup.
- `ConfirmAndRunGenerateAccountSchedules()`: Prompts user confirmation and generates missing account schedules for financial reporting. Initializes financial report management and creates required account schedules if not already defined in setup.
- `GLSetupAllAccScheduleNamesNotDefined(): Boolean`: Checks if all required account schedule names are properly defined in General Ledger Setup. Returns true if any standard financial report configurations are missing from setup.
- `GetCurrentAssets(): Text`: Returns the localized text description for the Current Assets account subcategory. Used for identifying and filtering current asset accounts in financial reports.
- `GetAR(): Text`: Returns the localized text description for the Accounts Receivable account subcategory. Used for identifying and filtering accounts receivable accounts in financial reports.
- `GetCash(): Text`: Returns the localized text description for the Cash account subcategory. Used for identifying and filtering cash and cash equivalent accounts in financial reports.
- `GetPrepaidExpenses(): Text`: Returns the localized text description for the Prepaid Expenses account subcategory. Used for identifying and filtering prepaid expense accounts in financial reports.
- `GetInventory(): Text`: Returns the localized text description for the Inventory account subcategory. Used for identifying and filtering inventory-related accounts in financial reports.
- `GetFixedAssets(): Text`: Returns the localized text description for the Fixed Assets account subcategory. Used for identifying and filtering fixed asset accounts in financial reports.
- `GetEquipment(): Text`: Returns the localized text description for the Equipment account subcategory. Used for identifying and filtering equipment-related accounts in financial reports.
- `GetAccumDeprec(): Text`: Returns the localized text description for the Accumulated Depreciation account subcategory. Used for identifying and filtering accumulated depreciation accounts in financial reports.
- `GetCurrentLiabilities(): Text`: Returns the localized text description for the Current Liabilities account subcategory. Used for identifying and filtering current liability accounts in financial reports.
- `GetPayrollLiabilities(): Text`: Returns the localized text description for the Payroll Liabilities account subcategory. Used for identifying and filtering payroll-related liability accounts in financial reports.
- `GetLongTermLiabilities(): Text`: Returns the localized text description for the Long Term Liabilities account subcategory. Used for identifying and filtering long-term liability accounts in financial reports.
- `GetCommonStock(): Text`: Returns the localized text description for the Common Stock account subcategory. Used for identifying and filtering common stock equity accounts in financial reports.
- `GetRetEarnings(): Text`: Returns the localized text description for the Retained Earnings account subcategory. Used for identifying and filtering retained earnings accounts in financial reports.
- `GetDistrToShareholders(): Text`: Returns the localized text description for the Distribution to Shareholders account subcategory. Used for identifying and filtering shareholder distribution accounts in financial reports.
- `GetIncomeService(): Text`: Returns the localized text description for the Service Income account subcategory. Used for identifying and filtering service revenue accounts in financial reports.
- `GetIncomeProdSales(): Text`: Returns the localized text description for the Product Sales Income account subcategory. Used for identifying and filtering product sales revenue accounts in financial reports.
- `GetIncomeSalesDiscounts(): Text`: Returns the localized text description for the Sales Discounts Income account subcategory. Used for identifying and filtering sales discount accounts in financial reports.
- `GetIncomeSalesReturns(): Text`: Returns the localized text description for the Sales Returns Income account subcategory. Used for identifying and filtering sales return accounts in financial reports.
- `GetIncomeInterest(): Text`: Returns the localized text description for the Interest Income account subcategory. Used for identifying and filtering interest income accounts in financial reports.
- `GetCOGSLabor(): Text`: Returns the localized text description for the Cost of Goods Sold - Labor account subcategory. Used for identifying and filtering labor-related cost of goods sold accounts in financial reports.
- `GetCOGSMaterials(): Text`: Returns the localized text description for the Cost of Goods Sold - Materials account subcategory. Used for identifying and filtering material-related cost of goods sold accounts in financial reports.
- `GetCOGSDiscountsGranted(): Text`: Returns the localized text description for the Cost of Goods Sold - Discounts Granted account subcategory. Used for identifying and filtering discount-related cost of goods sold accounts in financial reports.
- `GetRentExpense(): Text`: Returns the localized text description for the Rent Expense account subcategory. Used for identifying and filtering rent expense accounts in financial reports.
- `GetAdvertisingExpense(): Text`: Returns the localized text description for the Advertising Expense account subcategory. Used for identifying and filtering advertising expense accounts in financial reports.
- `GetInterestExpense(): Text`: Returns the localized text description for the Interest Expense account subcategory. Used for identifying and filtering interest expense accounts in financial reports.
- `GetFeesExpense(): Text`: Returns the localized text description for the Fees Expense account subcategory. Used for identifying and filtering fees expense accounts in financial reports.
- `GetInsuranceExpense(): Text`: Returns the localized text description for the Insurance Expense account subcategory. Used for identifying and filtering insurance expense accounts in financial reports.
- `GetPayrollExpense(): Text`: Returns the localized text description for the Payroll Expense account subcategory. Used for identifying and filtering payroll expense accounts in financial reports.
- `GetBenefitsExpense(): Text`: Returns the localized text description for the Benefits Expense account subcategory. Used for identifying and filtering employee benefits expense accounts in financial reports.
- `GetRepairsExpense(): Text`: Returns the localized text description for the Repairs Expense account subcategory. Used for identifying and filtering repairs and maintenance expense accounts in financial reports.
- `GetUtilitiesExpense(): Text`: Returns the localized text description for the Utilities Expense account subcategory. Used for identifying and filtering utilities expense accounts in financial reports.
- `GetOtherIncomeExpense(): Text`: Returns the localized text description for the Other Income/Expense account subcategory. Used for identifying and filtering miscellaneous income and expense accounts in financial reports.
- `GetTaxExpense(): Text`: Returns the localized text description for the Tax Expense account subcategory. Used for identifying and filtering tax expense accounts in financial reports.
- `GetTravelExpense(): Text`: Returns the localized text description for the Travel Expense account subcategory. Used for identifying and filtering travel expense accounts in financial reports.
- `GetVehicleExpenses(): Text`: Returns the localized text description for the Vehicle Expenses account subcategory. Used for identifying and filtering vehicle-related expense accounts in financial reports.
- `GetBadDebtExpense(): Text`: Returns the localized text description for the Bad Debt Expense account subcategory. Used for identifying and filtering bad debt expense accounts in financial reports.
- `GetSalariesExpense(): Text`: Returns the localized text description for the Salaries Expense account subcategory. Used for identifying and filtering salaries expense accounts in financial reports.
- `GetJobsCost(): Text`: Returns the localized text description for the Jobs Cost account subcategory. Used for identifying and filtering job cost accounts in financial reports.
- `GetIncomeJobs(): Text`: Returns the localized text description for the Jobs Income account subcategory. Used for identifying and filtering job income accounts in financial reports.
- `GetJobSalesContra(): Text`: Returns the localized text description for the Job Sales Contra account subcategory. Used for identifying and filtering job sales contra accounts in financial reports.
- `GetAccountCategory(var GLAccountCategory: Record "G/L Account Category"; Category: Option): Boolean`: Retrieves the G/L Account Category record for the specified primary account category. Filters for top-level categories with no parent entry and returns the first match.
- `GetAccountSubcategory(var GLAccountCategory: Record "G/L Account Category"; Category: Option; Description: Text): Boolean`: Retrieves the G/L Account Category record for a specific subcategory under a primary account category. Filters for child categories with a parent entry and matches the description text.
- `GetSubcategoryEntryNo(Category: Option; SubcategoryDescription: Text): Integer`: Returns the entry number for a subcategory under the specified primary account category. Searches for matching category and description, returning the entry number for category assignment.
- `CheckGLAccount(AccNo: Code[20]; CheckProdPostingGroup: Boolean; CheckDirectPosting: Boolean; AccountCategory: Option; AccountSubcategory: Text)`: Validates G/L Account setup and assigns account category and subcategory if not already set. Simplified version that delegates to the full CheckGLAccount procedure with default table and field parameters.
- `CheckGLAccount(TableNo: Integer; FieldNo: Integer; AccNo: Code[20]; CheckProdPostingGroup: Boolean; CheckDirectPosting: Boolean; AccountCategory: Option; AccountSubcategory: Text)`: Validates G/L Account setup and assigns account category and subcategory if not already set. Performs comprehensive validation including posting group checks and automatic category assignment.
- `CheckGLAccountWithoutCategory(AccNo: Code[20]; CheckProdPostingGroup: Boolean; CheckDirectPosting: Boolean)`: Validates G/L Account setup without requiring or assigning account categories. Performs basic validation for posting groups and direct posting without category enforcement.
- `LookupGLAccount(var AccountNo: Code[20]; AccountCategory: Option; AccountSubcategoryFilter: Text)`: Opens G/L Account lookup filtered by account category and subcategory for user selection. Simplified version that delegates to the full LookupGLAccount procedure with default table and field parameters.
- `LookupGLAccount(TableNo: Integer; FieldNo: Integer; var AccountNo: Code[20]; AccountCategory: Option; AccountSubcategoryFilter: Text)`: Opens G/L Account lookup filtered by account category and subcategory for user selection. Provides filtered lookup based on category and subcategory criteria with extensibility support.
- `LookupGLAccountWithoutCategory(var AccountNo: Code[20])`: Opens G/L Account lookup without category filtering for unrestricted user selection. Provides access to all posting-type G/L accounts without category or subcategory restrictions.

Plus 11 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 571 "Categ. Generate Acc. Schedules"](../codeunit/571.md) (6 calls: `ConfirmAndRunGenerateAccountSchedules → (object)`, `GetGLSetup → CreateBalanceSheet`, `GetGLSetup → CreateCashFlowStatement`, …)
- [Codeunit 18 "Financial Report Mgt."](../codeunit/18.md) (1 call: `ConfirmAndRunGenerateAccountSchedules → Initialize`)

## Called by

- [Codeunit 5208 "Create G/L Account"](../codeunit/5208.md) (24 calls: `OnRun → GetAccumDeprec`, `OnRun → GetAdvertisingExpense`, `OnRun → GetAR`, …)
- [Codeunit 571 "Categ. Generate Acc. Schedules"](../codeunit/571.md) (5 calls: `CreateBalanceSheet → GetGLSetup`, `CreateCashFlowStatement → GetGLSetup`, `CreateIncomeStatement → GetGLSetup`, …)
- [Codeunit 4037 "Helper Functions"](../codeunit/4037.md) (2 calls: `GetAcctCategoryEntryNo → GetAccountCategory`, `GetAcctSubCategoryEntryNo → GetAccountSubcategory`)
- [Codeunit 572 "Run Acc. Sched. Balance Sheet"](../codeunit/572.md) (2 calls: `OnRun → GetGLSetup`, `OnRun → RunAccountScheduleReport`)
- [Codeunit 573 "Run Acc. Sched. Income Stmt."](../codeunit/573.md) (2 calls: `OnRun → GetGLSetup`, `OnRun → RunAccountScheduleReport`)
- [Codeunit 574 "Run Acc. Sched. CashFlow Stmt."](../codeunit/574.md) (2 calls: `OnRun → GetGLSetup`, `OnRun → RunAccountScheduleReport`)
- [Codeunit 575 "Run Acc. Sched. Retained Earn."](../codeunit/575.md) (2 calls: `OnRun → GetGLSetup`, `OnRun → RunAccountScheduleReport`)
- [Report 151 "Balance Sheet"](../report/151.md) (2 calls: `OnInitReport → GetGLSetup`, `OnInitReport → RunAccountScheduleReport`)
- [Report 154 "Income Statement"](../report/154.md) (2 calls: `OnInitReport → GetGLSetup`, `OnInitReport → RunAccountScheduleReport`)
- [Report 155 "Statement of Cashflows"](../report/155.md) (2 calls: `OnInitReport → GetGLSetup`, `OnInitReport → RunAccountScheduleReport`)
- [Report 156 "Retained Earnings Statement"](../report/156.md) (2 calls: `OnInitReport → GetGLSetup`, `OnInitReport → RunAccountScheduleReport`)
- [Table 570 "G/L Account Category"](../table/570.md) (2 calls: `InitializeDataSet → (object)`, `InsertRow → AddCategory`)
- [Table 5813 "Inventory Posting Setup"](../table/5813.md) (2 calls: `CheckGLAccount → CheckGLAccount`, `LookupGLAccount → LookupGLAccount`)
- [Table 92 "Customer Posting Group"](../table/92.md) (2 calls: `CheckGLAccount → CheckGLAccount`, `LookupGLAccount → LookupGLAccount`)
- [Table 93 "Vendor Posting Group"](../table/93.md) (2 calls: `CheckGLAccount → CheckGLAccount`, `LookupGLAccount → LookupGLAccount`)
- [Codeunit 1917 "MigrationQB Helper Functions"](../codeunit/1917.md) (1 call: `GetAcctCategoryEntryNo → GetAccountCategory`)
- [Table 252 "General Posting Setup"](../table/252.md) (1 call: `LookupGLAccount → LookupGLAccount`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: 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: "G/L Account Category Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
