---
id: object/codeunit/4026
type: object
title: Codeunit 4026 "W1 Management"
summary: Codeunit 4026 "W1 Management" in HybridBCLast (Microsoft.DataMigration.BC). 11 public procedures, 14 events, 8 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: 0d26fcfff6887fc9644b446f264079d60f909ee89106e1caf46ea68fb8ce3da8
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Apps/W1/HybridBCLast/app/src/codeunits/W1Management.Codeunit.al
    title: src/Apps/W1/HybridBCLast/app/src/codeunits/W1Management.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: 4026
name: W1 Management
namespace: Microsoft.DataMigration.BC
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: 41
  events: 14
  subscribers: 8
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 9
  calls: 8
  called_by: 5
  implements: 0
---

# Codeunit 4026 "W1 Management"

> Codeunit 4026 "W1 Management" in HybridBCLast (Microsoft.DataMigration.BC). 11 public procedures, 14 events, 8 event subscribers. Introduced in BC29, still in BC30.

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

## Properties

| Property | Value |
|---|---|
| TableNo | Hybrid Replication Summary |

## Events published

- `OnAfterPopulateW1TableMappingForVersion(CountryCode: Text; TargetVersion: Decimal)` (integration)
- `OnPopulateW1TableMappingForVersion(CountryCode: Text; TargetVersion: Decimal)` (integration)
- `OnAfterCompanyUpgradeFailed(var HybridReplicationSummary: Record "Hybrid Replication Summary"; ErrorMessage: Text)` (integration)
  - subscribers: [Codeunit 4021 "Hybrid BC Last Management"](../codeunit/4021.md) UpdateStatusOnCompanyUpgradeFailed
- `OnAfterNonCompanyUpgradeFailed(var HybridReplicationSummary: Record "Hybrid Replication Summary"; ErrorMessage: Text)` (integration)
  - subscribers: [Codeunit 4021 "Hybrid BC Last Management"](../codeunit/4021.md) UpdateStatusOnNonCompanyMigrationFailed
- `OnAfterCompanyUpgradeCompleted(HybridReplicationSummary: Record "Hybrid Replication Summary")` (integration)
- `OnAfterNonCompanyUpgradeCompleted(HybridReplicationSummary: Record "Hybrid Replication Summary")` (integration)
- `OnInvokePerCompanyUpgrade(HybridReplicationSummary: Record "Hybrid Replication Summary"; CompanyName: Text[30])` (integration)
- `OnUpgradeNonCompanyDataForVersion(HybridReplicationSummary: Record "Hybrid Replication Summary"; TargetVersion: Decimal)` (integration)
- `OnTransformNonCompanyTableDataForVersion(CountryCode: Text; TargetVersion: Decimal)` (integration)
- `OnLoadNonCompanyTableDataForVersion(HybridReplicationSummary: Record "Hybrid Replication Summary"; CountryCode: Text; TargetVersion: Decimal)` (integration)
  - subscribers: [Codeunit 4028 "W1 Data Load"](../codeunit/4028.md) LoadNonCompanyTableData_15x, [Codeunit 4028 "W1 Data Load"](../codeunit/4028.md) LoadNonCompanyTableData_16x, [Codeunit 4028 "W1 Data Load"](../codeunit/4028.md) LoadNonCompanyTableData_17x, [Codeunit 4028 "W1 Data Load"](../codeunit/4028.md) LoadNonCompanyTableData_18x, [Codeunit 4028 "W1 Data Load"](../codeunit/4028.md) LoadNonCompanyTableData_19x, [Codeunit 4028 "W1 Data Load"](../codeunit/4028.md) LoadNonCompanyTableData_20x, [Codeunit 4028 "W1 Data Load"](../codeunit/4028.md) LoadNonCompanyTableData_21x
- `OnCreateSessionForUpgrade(var CreateSession: Boolean)` (internal)
- `OnUseLegacyUpgrade(var UseLegacyUpgrade: Boolean)` (integration)
- `OnBeforePerDatabaseUpgrade()` (integration)
- `OnBeforePerCompanyUpgrade()` (integration)

## Event subscriptions

- InvokeDataUpgrade subscribes to Codeunit "Hybrid Cloud Management" OnInvokeDataUpgrade
- RaiseNotificationForUpgrade subscribes to Page "Intelligent Cloud Management" OnOpenPageEvent
- RaiseNotificationForUpgradeNewUI subscribes to Page "Cloud Migration Management" OnOpenPageEvent
- OnIsUpgradeSupported subscribes to Codeunit "Hybrid Cloud Management" OnIsUpgradeSupported
- HandleOnOpenNewUI subscribes to Page "Intelligent Cloud Management" OnOpenNewUI
- HandleVerifyCanStartUpgrade subscribes to Codeunit "Hybrid Deployment" OnHandleVerifyCanStartUpgrade
- OnIsBCMigration subscribes to Page "Migration Table Mapping" OnIsBCMigration
- HandleOnSelectedProduct subscribes to Page "Hybrid Cloud Setup Wizard" OnSelectedProduct

## Procedures

- `SetUpgradePendingOnReplicationRunCompleted(RunId: Text[50]; SubscriptionId: Text; NotificationText: Text)`
- `IsCompanyReadyForUpgrade(HybridCompany: Record "Hybrid Company"): Boolean`
- `GetLegacyUpgradeSupported(): Boolean`
- `GetSupportedUpgradeVersions(var TargetVersions: List of [Decimal])`
- `PopulateTableMapping()`
- `TelemetryCategory(): Text`
- `InvokePerCompanyUpgrade(HybridReplicationSummary: Record "Hybrid Replication Summary"; CompanyName: Text[50])`
- `BeforePerDatabaseUpgrade()`
- `BeforePerCompanyUpgrade()`
- `UpdateStatusRecordsAfterUpgradePerDatabase()`
- `UpdateStatusRecordsAfterUpgradePerCompany()`

Plus 8 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 4001 "Hybrid Replication Summary"](../table/4001.md)

## 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 4001 "Hybrid Cloud Management"](../codeunit/4001.md) (8 calls: `InvokeDataUpgrade → RepairCompanionTableRecordConsistency`, `InvokeDataUpgrade → StartDataUpgrade`, `InvokeDataUpgrade → VerifyCanStartUpgrade`, …)
- [Codeunit 4021 "Hybrid BC Last Management"](../codeunit/4021.md) (5 calls: `GetSupportedUpgradeVersions → IsSupportedUpgrade`, `InvokeDataUpgrade → GetBCLastProductEnabled`, `OnIsBCMigration → GetBCLastProductEnabled`, …)
- [Codeunit 4020 "Hybrid BC Last Wizard"](../codeunit/4020.md) (4 calls: `HandleOnOpenNewUI → IsBCLastMigration`, `HandleOnSelectedProduct → ProductId`, `OnIsUpgradeSupported → IsBCLastMigration`, …)
- [Codeunit 5459 "JSON Management"](../codeunit/5459.md) (2 calls: `SetUpgradePendingOnReplicationRunCompleted → GetPropertyValueByName`, `SetUpgradePendingOnReplicationRunCompleted → InitializeObject`)
- [Codeunit 4029 "W1 Company Handler"](../codeunit/4029.md) (1 call: `UpgradePerCompanyData → (object)`)
- [Codeunit 4055 "Execute Non-Company Upgrade"](../codeunit/4055.md) (1 call: `UpgradeNonCompanyData → (object)`)
- [Codeunit 457 "Environment Information"](../codeunit/457.md) (1 call: `PopulateTableMapping → GetApplicationFamily`)
- [Codeunit 9999 "Upgrade Tag"](../codeunit/9999.md) (1 call: `InvokeDataUpgrade → RestoreUpgradeTagsFromBackup`)

## Called by

- [Codeunit 4024 "Hybrid BC Last Upgrade"](../codeunit/4024.md) (4 calls: `OnCheckPreconditionsPerCompany → BeforePerCompanyUpgrade`, `OnCheckPreconditionsPerDatabase → BeforePerDatabaseUpgrade`, `OnValidateUpgradePerCompany → UpdateStatusRecordsAfterUpgradePerCompany`, …)
- [Codeunit 4055 "Execute Non-Company Upgrade"](../codeunit/4055.md) (4 calls: `TryExecuteNonCompanyUpgrade → GetSupportedUpgradeVersions`, `TryExecuteNonCompanyUpgrade → OnLoadNonCompanyTableDataForVersion`, `TryExecuteNonCompanyUpgrade → OnTransformNonCompanyTableDataForVersion`, …)
- [Codeunit 4029 "W1 Company Handler"](../codeunit/4029.md) (2 calls: `OnRun → GetSupportedUpgradeVersions`, `OnRun → InvokePerCompanyUpgrade`)
- [Codeunit 4020 "Hybrid BC Last Wizard"](../codeunit/4020.md) (1 call: `PopulateMappingsOnAfterEnableMigration → PopulateTableMapping`)
- [Codeunit 4021 "Hybrid BC Last Management"](../codeunit/4021.md) (1 call: `ReplicationRunCompleted → SetUpgradePendingOnReplicationRunCompleted`)

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