Codeunit "Upgrade Triggers"

ID 2000000008
Namespace: System.Upgrade

Provides business events for extending application upgrade functionality including precondition checks, upgrade operations, validation, and post-upgrade commit operations.

Remarks

This codeunit serves as an extensibility layer for the application upgrade process, enabling partners and developers to implement custom upgrade logic, perform validation checks, execute data migration tasks, and handle post-upgrade operations. All events are business events that follow the standard upgrade workflow phases and can be subscribed to by external extensions.

Properties

Name Value
SingleInstance True

Events

OnCheckPreconditionsPerDatabase

Business event that is triggered during the precondition check phase of upgrade at the database level.

[BusinessEvent(False)]
procedure OnCheckPreconditionsPerDatabase()

Remarks

Use this event to implement custom precondition validations that must pass before upgrade can proceed. Perform database-level checks such as data integrity validation, required configurations, or compatibility assessments that apply across all companies in the database.

OnCheckPreconditionsPerCompany

Business event that is triggered during the precondition check phase of upgrade at the company level.

[BusinessEvent(False)]
procedure OnCheckPreconditionsPerCompany()

Remarks

Use this event to implement custom precondition validations that must pass before upgrade can proceed for a specific company. Perform company-specific checks such as data validation, configuration requirements, or business rule compliance that must be satisfied before upgrade operations begin.

OnUpgradePerDatabase

Business event that is triggered during the main upgrade phase at the database level.

[BusinessEvent(False)]
procedure OnUpgradePerDatabase()

Remarks

Use this event to implement custom upgrade logic that applies at the database level, such as system table modifications, global configuration updates, or cross-company data transformations. This event runs once per database during the upgrade process.

OnUpgradePerCompany

Business event that is triggered during the main upgrade phase at the company level.

[BusinessEvent(False)]
procedure OnUpgradePerCompany()

Remarks

Use this event to implement custom upgrade logic that applies to individual companies, such as company-specific data migrations, configuration updates, or business rule implementations. This event runs once per company during the upgrade process.

OnValidateUpgradePerDatabase

Business event that is triggered during the validation phase of upgrade at the database level.

[BusinessEvent(False)]
procedure OnValidateUpgradePerDatabase()

Remarks

Use this event to implement custom validation logic that verifies upgrade success at the database level. Perform checks to ensure that database-level upgrade operations completed successfully and that the system is in a consistent state.

OnValidateUpgradePerCompany

Business event that is triggered during the validation phase of upgrade at the company level.

[BusinessEvent(False)]
procedure OnValidateUpgradePerCompany()

Remarks

Use this event to implement custom validation logic that verifies upgrade success for individual companies. Perform company-specific checks to ensure that all upgrade operations completed successfully and that company data is in a consistent, usable state.

OnAfterUpgradeCommitPerDatabase

Business event that is triggered after upgrade operations are committed at the database level.

[BusinessEvent(False)]
procedure OnAfterUpgradeCommitPerDatabase()

Remarks

Use this event to implement post-upgrade operations that should execute after all database-level upgrade changes have been successfully committed. Perform cleanup operations, trigger external integrations, or execute final configuration steps that depend on completed upgrade operations.

OnAfterUpgradeCommitPerCompany

Business event that is triggered after upgrade operations are committed at the company level.

[BusinessEvent(False)]
procedure OnAfterUpgradeCommitPerCompany()

Remarks

Use this event to implement post-upgrade operations that should execute after all company-level upgrade changes have been successfully committed. Perform company-specific cleanup, trigger business process workflows, or execute final configuration steps that depend on completed company upgrade operations.

See also