---
id: object/codeunit/1311
type: object
title: Codeunit 1311 "Activities Mgt."
summary: Codeunit 1311 "Activities Mgt." in Base Application (Microsoft.RoleCenters). 26 public procedures, 8 events. Present since at least BC23, still in BC30, changed in BC24-27.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "27"
  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: d16c004175e327230c8ff531012a3c41469dbb40b1509ad05e1c9fc23f362483
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/RoleCenters/ActivitiesMgt.Codeunit.al
    title: src/Layers/W1/BaseApp/RoleCenters/ActivitiesMgt.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: 1311
name: Activities Mgt.
namespace: Microsoft.RoleCenters
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"
  - "26"
  - "27"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 43
  events: 8
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 7
  called_by: 6
  implements: 0
---

# Codeunit 1311 "Activities Mgt."

> Codeunit 1311 "Activities Mgt." in Base Application (Microsoft.RoleCenters). 26 public procedures, 8 events. Present since at least BC23, still in BC30, changed in BC24-27.

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

## Events published

- `OnAfterSetFilterOverduePurchaseInvoice(var VendorLedgerEntry: Record "Vendor Ledger Entry"; CalledFromWebService: Boolean)` (integration)
- `OnBeforeDrillDownCalcOverdueSalesInvoiceAmount(var CustLedgerEntry: Record "Cust. Ledger Entry"; var IsHandled: Boolean)` (integration)
- `OnBeforeDrillDownOverduePurchaseInvoiceAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean)` (integration)
- `OnBeforeSetFilterOverdueSalesInvoice(var CustLedgerEntry: Record "Cust. Ledger Entry"; CalledFromWebService: Boolean; var IsHandled: Boolean)` (integration)
- `OnGetRefreshInterval(var Interval: Duration)` (integration)
- `OnRefreshActivitiesCueDataOnBeforeModify(var ActivitiesCue: Record "Activities Cue")` (integration)
- `OnBeforeDrillDownNoOfReservedFromStockSalesOrders(var SalesHeader: Record "Sales Header")` (integration)
- `OnBeforeCalcNoOfReservedFromStockSalesOrders(var SalesHeader: Record "Sales Header"; var Number: Integer; var IsHandled: Boolean)` (integration)

## Procedures

- `OverdueSalesInvoiceAmount(CalledFromWebService: Boolean; UseCachedValue: Boolean): Decimal`
- `SetFilterOverdueSalesInvoice(var CustLedgerEntry: Record "Cust. Ledger Entry"; CalledFromWebService: Boolean)`
- `DrillDownCalcOverdueSalesInvoiceAmount()`
- `OverduePurchaseInvoiceAmount(CalledFromWebService: Boolean; UseCachedValue: Boolean): Decimal`
- `SetFilterOverduePurchaseInvoice(var VendorLedgerEntry: Record "Vendor Ledger Entry"; CalledFromWebService: Boolean)`
- `DrillDownOverduePurchaseInvoiceAmount()`
- `CalcSalesThisMonthAmount(CalledFromWebService: Boolean): Decimal`
- `CalcSalesThisMonthAmount(CalledFromWebService: Boolean; UseCachedValue: Boolean): Decimal` (obsolete 27.0: "Sales This Month" cue field is no longer calculated using cached value. Use CalcSalesThisMonthAmount(CalledFromWebService: Boolean) for live data.)
- `SetFilterForCalcSalesThisMonthAmount(var CustLedgerEntry: Record "Cust. Ledger Entry"; CalledFromWebService: Boolean)`
- `DrillDownSalesThisMonth()`
- `CalcSalesYTD(): Decimal`
- `CalcTop10CustomerSalesYTD(): Decimal`
- `CalcTop10CustomerSalesRatioYTD(): Decimal`
- `CalcAverageCollectionDays(): Decimal`
- `CalcAverageCollectionDays(UseCachedValue: Boolean): Decimal`
- `CalcNoOfReservedFromStockSalesOrders(): Integer`
- `CalcNoOfReservedFromStockSalesOrders(UseCachedValue: Boolean): Integer`
- `DrillDownNoOfReservedFromStockSalesOrders()`
- `CalcCashAccountsBalances(): Decimal`
- `DrillDownCalcCashAccountsBalances()`
- `CalcARAccountsBalances(): Decimal` (internal)
- `DrillDownCalcARAccountsBalances()` (internal)
- `IsCueDataStale(): Boolean`
- `IsCachedCueDataExpired(ActivitiesCue: Record "Activities Cue"; DataCacheComparisonDateTime: DateTime): Boolean` (internal)
- `CalcAPAccountsBalance(): Decimal` (internal)
- `DrillDownCalcAPAccountsBalances()` (internal)

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

- [Page 16 "Chart of Accounts"](../page/16.md) (3 calls: `DrillDownCalcAPAccountsBalances → (object)`, `DrillDownCalcARAccountsBalances → (object)`, `DrillDownCalcCashAccountsBalances → (object)`)
- [Page 118 "General Ledger Setup"](../page/118.md) (2 calls: `DrillDownCalcAPAccountsBalances → (object)`, `DrillDownCalcARAccountsBalances → (object)`)
- [Page 25 "Customer Ledger Entries"](../page/25.md) (2 calls: `DrillDownCalcOverdueSalesInvoiceAmount → (object)`, `DrillDownSalesThisMonth → (object)`)
- [Codeunit 40 "LogInManagement"](../codeunit/40.md) (1 call: `GetDefaultWorkDate → GetDefaultWorkDate`)
- [Codeunit 46 "SelectionFilterManagement"](../codeunit/46.md) (1 call: `CreateFilterForGLAccounts → AddQuotes`)
- [Page 29 "Vendor Ledger Entries"](../page/29.md) (1 call: `DrillDownOverduePurchaseInvoiceAmount → (object)`)
- [Page 9305 "Sales Order List"](../page/9305.md) (1 call: `DrillDownNoOfReservedFromStockSalesOrders → (object)`)

## Called by

- [Codeunit 1310 "O365 Activities Dictionary"](../codeunit/1310.md) (5 calls: `OnRun → CalcAverageCollectionDays`, `OnRun → CalcNoOfReservedFromStockSalesOrders`, `OnRun → CalcSalesThisMonthAmount`, …)
- [Page 1314 "AccountantPortal Activity Cues"](../page/1314.md) (5 calls: `SetAccountantPortalAmountFields → CalcAverageCollectionDays`, `SetAccountantPortalAmountFields → CalcSalesThisMonthAmount`, `SetAccountantPortalAmountFields → CalcTop10CustomerSalesYTD`, …)
- [Page 1310 "O365 Activities"](../page/1310.md) (3 calls: `CalculateCachedCueFieldValues → IsCachedCueDataExpired`, `OnPageBackgroundTaskError → (object)`, `OnPageBackgroundTaskError → IsCueDataStale`)
- [Page 1156 "Company Detail"](../page/1156.md) (2 calls: `CalculatePurchCues → OverduePurchaseInvoiceAmount`, `CalculateSalesCues → OverdueSalesInvoiceAmount`)
- [Page 1315 "Accountant Portal Finance Cues"](../page/1315.md) (1 call: `SetAccountantPortalFields → CalcCashAccountsBalances`)
- [Page 9037 "Accountant Activities"](../page/9037.md) (1 call: `CalculateCueFieldValues → CalcCashAccountsBalances`)

## Across versions

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

## Deprecations

- procedure CalcSalesThisMonthAmount: Pending 27.0 (#if not CLEAN27), ""Sales This Month" cue field is no longer calculated using cached value. Use CalcSalesThisMonthAmount(CalledFromWebService: Boolean) for live data."

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