---
id: object/codeunit/4021
type: object
title: Codeunit 4021 "Hybrid BC Last Management"
summary: Codeunit 4021 "Hybrid BC Last Management" in HybridBCLast. 3 public procedures, 13 event subscribers. Introduced in BC29, still in BC30.
tier: official
language: en
tags:
  - codeunit
  - hybridbclast
versions:
  introduced: "29"
  last_changed: null
  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: 76765ec2e3eaafe60b91d453a0155286cede721c7fa0206c742e12abd60c8831
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/HybridBCLast/app/src/codeunits/HybridBCLastManagement.Codeunit.al
    title: src/Apps/W1/HybridBCLast/app/src/codeunits/HybridBCLastManagement.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: 4021
name: Hybrid BC Last Management
namespace: null
app: HybridBCLast
extends: null
first_version: "29"
last_version: "30"
present_in:
  - "29"
  - "30"
changed_in: []
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 20
  events: 0
  subscribers: 13
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 5
  called_by: 2
  implements: 0
---

# Codeunit 4021 "Hybrid BC Last Management"

> Codeunit 4021 "Hybrid BC Last Management" in HybridBCLast. 3 public procedures, 13 event subscribers. Introduced in BC29, still in BC30.

HybridBCLast · BC29-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/HybridBCLast/app/src/codeunits/HybridBCLastManagement.Codeunit.al) · facts from BC29

## Event subscriptions

- GetMessageOnResolveMessageCode subscribes to Codeunit "Hybrid Message Management" OnResolveMessageCode
- ReplicationRunCompleted subscribes to Codeunit "Hybrid Cloud Management" OnReplicationRunCompleted
- HandleVerifyCanReplicateCompanies subscribes to Codeunit "Hybrid Cloud Management" OnVerifyCanReplicateCompanies
- OnCanChangeSetup subscribes to Page "Cloud Mig - Select Tables" OnCanChangeSetup
- CanIntelligentCloudSetupTableBeModified subscribes to Codeunit "Cloud Mig. Replicate Data Mgt." OnCanIntelligentCloudSetupTableBeModified
- UpdateStatusOnTableLoaded subscribes to Codeunit "W1 Data Load" OnAfterCompanyTableLoad
- UpdateStatusOnNonCompanyTableLoaded subscribes to Codeunit "W1 Data Load" OnAfterNonCompanyTableLoad
- UpdateStatusOnCompanyUpgradeFailed subscribes to Codeunit "W1 Management" OnAfterCompanyUpgradeFailed
- UpdateStatusOnNonCompanyMigrationFailed subscribes to Codeunit "W1 Management" OnAfterNonCompanyUpgradeFailed
- BackupUpgradeTags subscribes to Codeunit "Hybrid Cloud Management" OnBackupUpgradeTags
- HandleSetAllUpgradeTags subscribes to Codeunit "Upgrade Tag" OnSetAllUpgradeTags
- OnInsertDefaultTableMappings subscribes to Codeunit "Hybrid Cloud Management" OnInsertDefaultTableMappings
- OnRecordLinkMigrationSourceSupported subscribes to Codeunit "Notification Handler" OnSourceSupported

## Procedures

- `GetAppId(): Guid`
- `IsSupportedUpgrade(TargetVersion: Decimal): Boolean` (internal)
- `GetBCLastProductEnabled(): Boolean`

Plus 4 local procedures.

## 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 4020 "Hybrid BC Last Wizard"](../codeunit/4020.md) (8 calls: `CanIntelligentCloudSetupTableBeModified → IsBCLastMigration`, `GetBCLastProductEnabled → ProductId`, `GetMessageOnResolveMessageCode → ProductId`, …)
- [Codeunit 4001 "Hybrid Cloud Management"](../codeunit/4001.md) (3 calls: `HandleSetAllUpgradeTags → IsCompanyUnderUpgrade`, `OnInsertDefaultTableMappings → InsertRecordLinkTableMapping`, `UpdateStatusOnHybridReplicationCompleted → CanHandleNotification`)
- [Codeunit 40021 "Cloud Mig. Replicate Data Mgt."](../codeunit/40021.md) (3 calls: `CheckRecordCanBeIncluded → CanChangeIntelligentCloudStatus`, `UpdateStatusOnNonCompanyTableLoaded → UpdateStatusOnNonCompanyTableLoaded`, `UpdateStatusOnTableLoaded → UpdateStatusOnTableLoaded`)
- [Codeunit 4011 "Hybrid Message Management"](../codeunit/4011.md) (2 calls: `UpdateStatusOnHybridReplicationCompleted → ResolveMessageCode`, `UpdateStatusOnHybridReplicationCompleted → SetHybridReplicationDetailStatus`)
- [Codeunit 4026 "W1 Management"](../codeunit/4026.md) (1 call: `ReplicationRunCompleted → SetUpgradePendingOnReplicationRunCompleted`)

## Called by

- [Codeunit 4026 "W1 Management"](../codeunit/4026.md) (5 calls: `GetSupportedUpgradeVersions → IsSupportedUpgrade`, `InvokeDataUpgrade → GetBCLastProductEnabled`, `OnIsBCMigration → GetBCLastProductEnabled`, …)
- [Codeunit 40030 "Table and Field Move Mappings"](../codeunit/40030.md) (1 call: `OnInsertDefaultTableMappings → GetBCLastProductEnabled`)

## Across versions

- Present in: BC29-30
- Changed (declaration) in: none

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