Codeunit 570 "G/L Account Category Mgt."
Base Application · Microsoft.Finance.GeneralLedger.Account
Across versions
- BC23-27present
- BC286 procedures added, 2 procedures removed
- BC29-30unchanged
Neighbourhood 18 connected objects and pages
Base Application · Microsoft.Finance.GeneralLedger.Account · BC23-30 · source at ea08af5e · 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.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” (6 calls:
ConfirmAndRunGenerateAccountSchedules → (object),GetGLSetup → CreateBalanceSheet,GetGLSetup → CreateCashFlowStatement, …) - Codeunit 18 “Financial Report Mgt.” (1 call:
ConfirmAndRunGenerateAccountSchedules → Initialize)
Called by
- Codeunit 5208 “Create G/L Account” (24 calls:
OnRun → GetAccumDeprec,OnRun → GetAdvertisingExpense,OnRun → GetAR, …) - Codeunit 571 “Categ. Generate Acc. Schedules” (5 calls:
CreateBalanceSheet → GetGLSetup,CreateCashFlowStatement → GetGLSetup,CreateIncomeStatement → GetGLSetup, …) - Codeunit 4037 “Helper Functions” (2 calls:
GetAcctCategoryEntryNo → GetAccountCategory,GetAcctSubCategoryEntryNo → GetAccountSubcategory) - Codeunit 572 “Run Acc. Sched. Balance Sheet” (2 calls:
OnRun → GetGLSetup,OnRun → RunAccountScheduleReport) - Codeunit 573 “Run Acc. Sched. Income Stmt.” (2 calls:
OnRun → GetGLSetup,OnRun → RunAccountScheduleReport) - Codeunit 574 “Run Acc. Sched. CashFlow Stmt.” (2 calls:
OnRun → GetGLSetup,OnRun → RunAccountScheduleReport) - Codeunit 575 “Run Acc. Sched. Retained Earn.” (2 calls:
OnRun → GetGLSetup,OnRun → RunAccountScheduleReport) - Report 151 “Balance Sheet” (2 calls:
OnInitReport → GetGLSetup,OnInitReport → RunAccountScheduleReport) - Report 154 “Income Statement” (2 calls:
OnInitReport → GetGLSetup,OnInitReport → RunAccountScheduleReport) - Report 155 “Statement of Cashflows” (2 calls:
OnInitReport → GetGLSetup,OnInitReport → RunAccountScheduleReport) - Report 156 “Retained Earnings Statement” (2 calls:
OnInitReport → GetGLSetup,OnInitReport → RunAccountScheduleReport) - Table 570 “G/L Account Category” (2 calls:
InitializeDataSet → (object),InsertRow → AddCategory) - Table 5813 “Inventory Posting Setup” (2 calls:
CheckGLAccount → CheckGLAccount,LookupGLAccount → LookupGLAccount) - Table 92 “Customer Posting Group” (2 calls:
CheckGLAccount → CheckGLAccount,LookupGLAccount → LookupGLAccount) - Table 93 “Vendor Posting Group” (2 calls:
CheckGLAccount → CheckGLAccount,LookupGLAccount → LookupGLAccount) - Codeunit 1917 “MigrationQB Helper Functions” (1 call:
GetAcctCategoryEntryNo → GetAccountCategory) - Table 252 “General Posting Setup” (1 call:
LookupGLAccount → LookupGLAccount)
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.