---
id: object/codeunit/841
type: object
title: Codeunit 841 "Cash Flow Management"
summary: Codeunit 841 "Cash Flow Management" in Base Application (Microsoft.CashFlow.Forecast). 20 public procedures, 11 events. Present since at least BC23, still in BC30, changed in BC24-25.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "25"
  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: 5044102d1f0823334967554c3db9ca18851d7321248a33e90e79ebe03a9d999b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/CashFlow/Forecast/CashFlowManagement.Codeunit.al
    title: src/Layers/W1/BaseApp/CashFlow/Forecast/CashFlowManagement.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: 841
name: Cash Flow Management
namespace: Microsoft.CashFlow.Forecast
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 57
  events: 11
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 3
  calls: 9
  called_by: 13
  implements: 0
---

# Codeunit 841 "Cash Flow Management"

> Codeunit 841 "Cash Flow Management" in Base Application (Microsoft.CashFlow.Forecast). 20 public procedures, 11 events. Present since at least BC23, still in BC30, changed in BC24-25.

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

## Events published

- `OnBeforeGetTaxAmountFromPurchaseOrder(PurchaseHeader: Record "Purchase Header"; var VATAmount: Decimal; var IsHandled: Boolean)` (integration)
- `OnBeforeGetTaxAmountFromSalesOrder(SalesHeader: Record "Sales Header"; var VATAmount: Decimal; var IsHandled: Boolean)` (integration)
- `OnBeforeShowSource(CFVariant: Variant; var Handled: Boolean)` (integration)
- `OnBeforeShowSourceDocument(CFVariant: Variant; var Handled: Boolean)` (integration)
- `OnBeforeUpdateCashFlowForecast(AzureAIEnabled: Boolean; var Handled: Boolean)` (integration)
- `OnShowSourceLocalSourceTypeCase(SourceType: Enum "Cash Flow Source Type"; SourceNo: Code[20]; ShowDocument: Boolean; DocumentNo: Code[20]; DocumentDate: Date; BudgetName: Code[10]; var IsHandled: Boolean)` (integration)
  - subscribers: [Codeunit 891 "Serv. Cash Flow Management"](../codeunit/891.md) OnShowSourceLocalSourceTypeCase
- `OnAfterSetViewOnVATEntryForTaxCalc(var VATEntry: Record "VAT Entry"; TaxPaymentDueDate: Date; DummyDate: Date)` (integration)
- `OnAfterCreateCashFlowAccounts(LiquidFundsGLAccountFilter: Code[250])` (integration)
  - subscribers: [Codeunit 891 "Serv. Cash Flow Management"](../codeunit/891.md) OnAfterCreateCashFlowAccounts
- `OnAfterGetTotalAmountFromSalesOrder(SalesHeader: Record "Sales Header"; var Result: Decimal)` (integration)
- `OnBeforeInsertOnCreateCashFlowSetup(var CashFlowSetup: Record "Cash Flow Setup"; CashFlowNoSeriesCode: Code[20])` (integration)
  - subscribers: [Codeunit 891 "Serv. Cash Flow Management"](../codeunit/891.md) OnBeforeInsertOnCreateCashFlowSetup
- `OnBeforeRunSuggestWorksheetLinesOnUpdateCashFlowForecast(var SuggestWorksheetLines: Report "Suggest Worksheet Lines")` (integration)

## Procedures

- `ShowSourceDocument(CFVariant: Variant)`
- `ShowSource(CFVariant: Variant)`
- `CashFlowNameFullLength(CashFlowNo: Code[20]): Text[100]`
- `CashFlowAccountName(CashFlowAccountNo: Code[20]): Text[100]`
- `RecurrenceToRecurringFrequency(Recurrence: Option " ",Daily,Weekly,Monthly,Quarterly,Yearly): Text`
- `RecurringFrequencyToRecurrence(RecurringFrequency: DateFormula; var RecurrenceOut: Option " ",Daily,Weekly,Monthly,Quarterly,Yearly)`
- `CreateAndStartJobQueueEntry(UpdateFrequency: Option Never,Daily,Weekly)`
- `DeleteJobQueueEntries()`
- `GetCashAccountFilter(): Text`
- `SetupCashFlow(LiquidFundsGLAccountFilter: Code[250])`
- `CreateCashFlowAccount(SourceType: Enum "Cash Flow Source Type"; LiquidFundsGLAccountFilter: Code[250])`
- `GetNoFromSourceType(SourceType: Option): Text`
- `UpdateCashFlowForecast(AzureAIEnabled: Boolean)`
- `SetViewOnPurchaseHeaderForTaxCalc(var PurchaseHeader: Record "Purchase Header"; TaxPaymentDueDate: Date)`
- `SetViewOnSalesHeaderForTaxCalc(var SalesHeader: Record "Sales Header"; TaxPaymentDueDate: Date)`
- `SetViewOnVATEntryForTaxCalc(var VATEntry: Record "VAT Entry"; TaxPaymentDueDate: Date)`
- `GetTaxAmountFromSalesOrder(SalesHeader: Record "Sales Header"): Decimal`
- `GetTaxAmountFromPurchaseOrder(PurchaseHeader: Record "Purchase Header"): Decimal`
- `GetTotalAmountFromSalesOrder(SalesHeader: Record "Sales Header"): Decimal`
- `GetTotalAmountFromPurchaseOrder(PurchaseHeader: Record "Purchase Header"): Decimal`

Plus 26 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 456 "Job Queue Management"](../codeunit/456.md) (3 calls: `CreateAndStartJobQueueEntry → CreateJobQueueEntry`, `DeleteExistingSetup → DeleteJobQueueEntries`, `DeleteJobQueueEntries → DeleteJobQueueEntries`)
- [Codeunit 453 "Job Queue - Enqueue"](../codeunit/453.md) (1 call: `CreateAndStartJobQueueEntry → (object)`)
- [Codeunit 80 "Sales-Post"](../codeunit/80.md) (1 call: `GetTaxAmountFromSalesOrder → SumSalesLines`)
- [Codeunit 844 "Cash Flow Wksh.-Register Batch"](../codeunit/844.md) (1 call: `UpdateCashFlowForecast → (object)`)
- [Codeunit 90 "Purch.-Post"](../codeunit/90.md) (1 call: `GetTaxAmountFromPurchaseOrder → SumPurchLines`)
- [Page 16 "Chart of Accounts"](../page/16.md) (1 call: `ShowLiquidFunds → (object)`)
- [Page 17 "G/L Account Card"](../page/17.md) (1 call: `ShowLiquidFunds → (object)`)
- [Page 315 "VAT Entries"](../page/315.md) (1 call: `ShowTax → (object)`)
- [Page 5600 "Fixed Asset Card"](../page/5600.md) (1 call: `ShowFixedAsset → (object)`)

## Called by

- [Codeunit 850 "Cash Flow Forecast Handler"](../codeunit/850.md) (4 calls: `CalculateNotPostedPurchOrderSumAmountInPeriod → GetTaxAmountFromPurchaseOrder`, `CalculateNotPostedPurchOrderSumAmountInPeriod → GetTotalAmountFromPurchaseOrder`, `CalculateNotPostedSalesOrderSumAmountInPeriod → GetTaxAmountFromSalesOrder`, …)
- [Codeunit 5686 "Run CashFlow Forecast Wizard"](../codeunit/5686.md) (3 calls: `OnRun → GetCashAccountFilter`, `OnRun → SetupCashFlow`, `OnRun → UpdateCashFlowForecast`)
- [Page 1818 "Cash Flow Forecast Wizard"](../page/1818.md) (3 calls: `FinishAction → SetupCashFlow`, `FinishAction → UpdateCashFlowForecast`, `GetLiquidFundsGLAccountFilter → GetCashAccountFilter`)
- [Codeunit 891 "Serv. Cash Flow Management"](../codeunit/891.md) (2 calls: `OnAfterCreateCashFlowAccounts → CreateCashFlowAccount`, `OnBeforeInsertOnCreateCashFlowSetup → GetNoFromSourceType`)
- [Page 841 "Cash Flow Worksheet"](../page/841.md) (2 calls: `OnAfterGetCurrRecord → CashFlowAccountName`, `OnAfterGetCurrRecord → CashFlowNameFullLength`)
- [Report 840 "Suggest Worksheet Lines"](../report/840.md) (2 calls: `GetTaxAmountFromSource → GetTaxAmountFromPurchaseOrder`, `GetTaxAmountFromSource → GetTaxAmountFromSalesOrder`)
- [Table 847 "Cash Flow Forecast Entry"](../table/847.md) (2 calls: `ShowSource → ShowSource`, `ShowSource → ShowSourceDocument`)
- [Codeunit 842 "Cash Flow Forecast Update"](../codeunit/842.md) (1 call: `OnRun → UpdateCashFlowForecast`)
- [Page 1157 "Client Detail Cash Flow Chart"](../page/1157.md) (1 call: `RecalculateAndUpdateChart → UpdateCashFlowForecast`)
- [Page 857 "Cash Flow Manual Revenues"](../page/857.md) (1 call: `GetRecord → RecurringFrequencyToRecurrence`)
- [Page 859 "Cash Flow Manual Expenses"](../page/859.md) (1 call: `GetRecord → RecurringFrequencyToRecurrence`)
- [Page 869 "Cash Flow Forecast Chart"](../page/869.md) (1 call: `RecalculateAndUpdateChart → UpdateCashFlowForecast`)
- [Table 846 "Cash Flow Worksheet Line"](../table/846.md) (1 call: `ShowSource → ShowSource`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-25

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: "Cash Flow Management")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
