---
title: "Codeunit 131340 Library - Cost Accounting"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/131340-library-cost-accounting/
type: codeunit
id: 131340
name: "Library - Cost Accounting"
app: "Application Test Library"
versions: "28-29"
build: 29.0.54011.55644
countries: "W1, DE, US"
source: "https://jonas-paprotka.de/ref/codeunit/131340-library-cost-accounting/source/"
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 131340 Library - Cost Accounting

JOP-AL, https://jonas-paprotka.de/ref/codeunit/131340-library-cost-accounting/

| | |
| --- | --- |
| App | Application Test Library |
| Versions | 28-29 |
| Minors | W1 28.0-29.0; DE 28.0-29.0; US 28.0-29.0, [every minor](https://jonas-paprotka.de/ref/codeunit/131340-library-cost-accounting/editions.json) |
| Source file | LibraryCostAccounting.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| AllocateCostsFromTo | (var CostAllocation: TestRequestPage "Cost Allocation"; FromLevel: Integer; ToLevel: Integer; AllocDate: Date; AllocGroup: Code[10]; CostBudgetName: Code[10]) | - | public | 28-29 | - | - |
| CheckAllocTargetSharePercent | (CostAllocationSource: Record "Cost Allocation Source") | - | public | 28-29 | - | - |
| CheckBlockedDimCombination | () | - | public | 28-29 | - | - |
| CheckBlockedDimensionValues | (AccountNo: Code[20]) | - | public | 28-29 | - | - |
| CheckCostJnlLineConsistency | (var CostJournalLine: Record "Cost Journal Line") | - | public | 28-29 | - | - |
| ClearCostJournalLines | (CostJournalBatch: Record "Cost Journal Batch") | - | public | 28-29 | - | - |
| CopyCABudgetToCABudget | (var CopyCAToCARP: TestRequestPage "Copy Cost Budget"; SourceCostBudget: Code[10]; TargetCostBudget: Code[10]; AmtMultiplicationRatio: Decimal; DateFormula: Text[30]; NoOfCopies: Integer) | - | public | 28-29 | - | - |
| CopyCABudgetToGLBudget | (var CopyCAToGLRP: TestRequestPage "Copy Cost Acctg. Budget to G/L"; SourceCostBudget: Code[10]; TargetCostBudget: Code[10]; AmtMultiplicationRatio: Decimal; DateFormula: Text[30]; NoOfCopies: Integer) | - | public | 28-29 | - | - |
| CopyGLBudgetToCABudget | (var CopyGLToCARP: TestRequestPage "Copy G/L Budget to Cost Acctg."; SourceGLBudget: Code[10]; TargetCostBudget: Code[10]) | - | public | 28-29 | - | - |
| CostCenterDimension | () | Code[20] | public | 28-29 | - | - |
| CostObjectDimension | () | Code[20] | public | 28-29 | - | - |
| CreateAllocSource | (var CostAllocationSource: Record "Cost Allocation Source"; TypeOfID: Option "Auto Generated",Custom) | - | public | 28-29 | - | - |
| CreateAllocSourceWithCCenter | (var CostAllocationSource: Record "Cost Allocation Source"; TypeOfID: Option) | - | public | 28-29 | - | - |
| CreateAllocSourceWithCObject | (var CostAllocationSource: Record "Cost Allocation Source"; TypeOfID: Option) | - | public | 28-29 | - | - |
| CreateAllocTarget | (var CostAllocationTarget: Record "Cost Allocation Target"; CostAllocationSource: Record "Cost Allocation Source"; Share: Decimal; Base: Enum "Cost Allocation Target Base"; AllocationType: Enum "Cost Allocation Target Type") | - | public | 28-29 | - | - |
| CreateAllocTargetWithCCenter | (var CostAllocationTarget: Record "Cost Allocation Target"; CostAllocationSource: Record "Cost Allocation Source"; Share: Decimal; Base: Enum "Cost Allocation Target Base"; AllocationType: Enum "Cost Allocation Target Type") | - | public | 28-29 | - | - |
| CreateAllocTargetWithCObject | (var CostAllocationTarget: Record "Cost Allocation Target"; CostAllocationSource: Record "Cost Allocation Source"; Share: Decimal; Base: Enum "Cost Allocation Target Base"; AllocationType: Enum "Cost Allocation Target Type") | - | public | 28-29 | - | - |
| CreateBalanceSheetGLAccount | (var GLAccount: Record "G/L Account") | - | public | 28-29 | - | - |
| CreateCostBudgetEntry | (var CostBudgetEntry: Record "Cost Budget Entry"; CostBudgetName: Code[10]) | - | public | 28-29 | - | - |
| CreateCostBudgetName | (var CostBudgetName: Record "Cost Budget Name") | - | public | 28-29 | - | - |
| CreateCostCenter | (var CostCenter: Record "Cost Center") | - | public | 28-29 | - | - |
| CreateCostCenterFromDimension | (var CostCenter: Record "Cost Center") | - | public | 28-29 | - | - |
| CreateCostJournalBatch | (var CostJournalBatch: Record "Cost Journal Batch"; CostJournalTemplateName: Code[10]) | - | public | 28-29 | - | - |
| CreateCostJournalTemplate | (var CostJournalTemplate: Record "Cost Journal Template") | - | public | 28-29 | - | - |
| CreateCostJnlBatchWithDelOpt | (var CostJournalBatch: Record "Cost Journal Batch"; CostJournalTemplateName: Code[10]; DeleteAfterPosting: Boolean) | - | public | 28-29 | - | - |
| CreateCostJournalLine | (var CostJournalLine: Record "Cost Journal Line"; CostJournalTemplateName: Code[10]; CostJournalBatchName: Code[10]) | - | public | 28-29 | - | - |
| CreateCostJournalLineBasic | (var CostJournalLine: Record "Cost Journal Line"; CostJournalTemplateName: Code[10]; CostJournalBatchName: Code[10]; PostingDate: Date; CostTypeNo: Code[20]; BalCostTypeNo: Code[20]) | - | public | 28-29 | - | - |
| CreateCostObject | (var CostObject: Record "Cost Object") | - | public | 28-29 | - | - |
| CreateCostObjectFromDimension | (var CostObject: Record "Cost Object") | - | public | 28-29 | - | - |
| CreateCostType | (var CostType: Record "Cost Type") | - | public | 28-29 | - | - |
| CreateCostTypeNoGLRange | (var CostType: Record "Cost Type") | - | public | 28-29 | - | - |
| CreateCostTypeWithCombine | (var CostType: Record "Cost Type"; CombineEntries: Option) | - | public | 28-29 | - | - |
| CreateCostTypeWithGLRange | (var CostType: Record "Cost Type"; MultipleGLAccounts: Boolean) | - | public | 28-29 | - | - |
| CreateIncomeStmtGLAccount | (var GLAccount: Record "G/L Account") | - | public | 28-29 | - | - |
| CreateJnlLine | (var GenJournalLine: Record "Gen. Journal Line"; AccountNo: Code[20]) | - | public | 28-29 | - | - |
| DeleteAllCostTypeEntries | () | - | public | 28-29 | - | - |
| DeleteCostBudgetRegEntries | () | - | public | 28-29 | - | - |
| DeleteCostBudgetRegEntriesFrom | (StartEntry: Integer) | - | public | 28-29 | - | - |
| DeleteCostRegisterEntries | () | - | public | 28-29 | - | - |
| DeleteCostRegisterEntriesFrom | (StartEntry: Integer) | - | public | 28-29 | - | - |
| DeleteBlockedDimCombinations | (var DimensionCombination: Record "Dimension Combination") | - | public | 28-29 | - | - |
| FindAllocSource | (var CostAllocationSource: Record "Cost Allocation Source") | - | public | 28-29 | - | - |
| FindCostType | (var CostType: Record "Cost Type") | - | public | 28-29 | - | - |
| FindCostTypeLinkedToGLAcc | (var CostType: Record "Cost Type") | - | public | 28-29 | - | - |
| FindCostTypeWithCostCenter | (var CostType: Record "Cost Type") | - | public | 28-29 | - | - |
| FindCostCenter | (var CostCenter: Record "Cost Center") | - | public | 28-29 | - | - |
| FindCostJournalBatch | (var CostJournalBatch: Record "Cost Journal Batch"; CostJournalTemplateName: Code[10]) | - | public | 28-29 | - | - |
| FindCostJnlBatchWithDelOption | (var CostJournalBatch: Record "Cost Journal Batch"; CostJournalTemplateName: Code[10]; DeleteAfterPosting: Boolean) | - | public | 28-29 | - | - |
| FindCostJournalTemplate | (var CostJournalTemplate: Record "Cost Journal Template") | - | public | 28-29 | - | - |
| FindCostObject | (var CostObject: Record "Cost Object") | - | public | 28-29 | - | - |
| FindGLAccLinkedToCostType | (var GLAccount: Record "G/L Account") | - | public | 28-29 | - | - |
| FindGLAccountsByCostType | (var GLAccount: Record "G/L Account"; GLAccountRange: Text[50]) | - | public | 28-29 | - | - |
| FindIncomeStmtGLAccount | (var GLAccount: Record "G/L Account") | - | public | 28-29 | - | - |
| GetAllCostTypes | (var CostType: Record "Cost Type") | - | public | 28-29 | - | - |
| GetAllIncomeStmtGLAccounts | (var GLAccount: Record "G/L Account") | - | public | 28-29 | - | - |
| GetAllocTargetEntryAmount | (var CostAllocationTarget: Record "Cost Allocation Target"; TotalAmount: Decimal; TableNumber: Integer; KeyFieldNumber: Integer; AmountFieldNumber: Integer; FromValue: Integer; ToValue: Integer) | Decimal | public | 28-29 | - | - |
| InitializeCASetup | () | - | public | 28-29 | - | - |
| InitializeCASourceCodes | () | - | public | 28-29 | - | - |
| LastAllocSourceID | () | Code[10] | public | 28-29 | - | - |
| LastAllocTargetID | (CostAllocationSource: Record "Cost Allocation Source") | Integer | public | 28-29 | - | - |
| PostCostJournalLine | (CostJournalLine: Record "Cost Journal Line") | - | public | 28-29 | - | - |
| PostGenJournalLine | (AccountNo: Code[20]) | - | public | 28-29 | - | - |
| SetAlignment | (FieldNo: Integer; FieldOptionValue: Option) | - | public | 28-29 | - | - |
| SetAutotransferFromGL | (Autotransfer: Boolean) | - | public | 28-29 | - | - |
| SetDefaultDimension | (GLAccountNo: Code[20]) | - | public | 28-29 | - | - |
| SetupGeneralJnlBatch | (var GenJournalBatch: Record "Gen. Journal Batch") | - | public | 28-29 | - | - |
| SetupGLAccount | (var GLAccount: Record "G/L Account") | - | public | 28-29 | - | - |
| TransferBudgetToActual | (var TransferToActual: TestRequestPage "Transfer Budget to Actual"; BudgetName: Code[10]; DateRange: Text[30]) | - | public | 28-29 | - | - |
| TransferGLEntries | () | - | public | 28-29 | - | - |
| UpdateAllocSourceWithCCenter | (var CostAllocationSource: Record "Cost Allocation Source") | - | public | 28-29 | - | - |
| UpdateAllocSourceWithCObject | (var CostAllocationSource: Record "Cost Allocation Source") | - | public | 28-29 | - | - |
| UpdateAllocTargetWithCCenter | (var CostAllocationTarget: Record "Cost Allocation Target") | - | public | 28-29 | - | - |
| UpdateAllocTargetWithCObject | (var CostAllocationTarget: Record "Cost Allocation Target") | - | public | 28-29 | - | - |
| UpdateCostTypeWithCostCenter | (var CostType: Record "Cost Type") | - | public | 28-29 | - | - |
| UpdateCostTypeWithCostObject | (var CostType: Record "Cost Type") | - | public | 28-29 | - | - |
| ValidateEntriesTransfered | () | - | public | 28-29 | - | - |
| ValidateGLAccountCostTypeRef | (CostTypeNo: Code[20]) | - | public | 28-29 | - | - |
| ValidateGLAccountIsIncomeStmt | (var CostType: Record "Cost Type") | - | public | 28-29 | - | - |
| VerifyCostTypeIntegrity | () | - | public | 28-29 | - | - |

## Source

Symbols: Microsoft.ApplicationTestLibrary.symbols.d852d5d2-a39d-4179-baeb-f99a19e32510, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-11-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
