BCQuality rule · eventsAL Developmentofficial - Microsoftderived - from the source, no model text

External business event notifications require a committed transaction

Notifications for an ExternalBusinessEvent are sent only after the current transaction commits. If that transaction rolls back, the notification is not sent, even if the event was raised before the error. This differs from reasoning about AL BusinessEvent or IntegrationEvent subscribers.

Rule on GitHub · microsoft layer · events · BC 22.. · tier official · derived

Description

Notifications for an ExternalBusinessEvent are sent only after the current transaction commits. If that transaction rolls back, the notification is not sent, even if the event was raised before the error. This differs from reasoning about AL BusinessEvent or IntegrationEvent subscribers.

The attribute is available from runtime 11.0 (BC 22); Microsoft’s business events overview describes the feature as preview. The samples use BC 22 syntax; on BC 23 and later, import System.Integration for EventCategory.

Best Practice

Use external business events to notify consumers of business outcomes whose transaction can commit. A raise within that transaction is valid: it does not itself commit, and notification waits for the transaction to commit. Do not flag such a raise merely because it precedes the commit.

If a failed operation must be reported externally, design failure reporting so it does not depend on a notification raised in the transaction being rolled back. Do not add an unconditional Commit() solely to force a notification; preserve the operation’s required atomicity.

See sample: external-business-events-require-commit-for-notification.good.al.

Anti Pattern

Raise an external business event as a failure notification and then roll back the same transaction, while relying on the notification to reach the external consumer. The rollback discards the notification, so the consumer is not notified of that failure.

See sample: external-business-events-require-commit-for-notification.bad.al.

References

Examples

Changed by


From microsoft/BCQuality at 863acaa, MIT License, Copyright (c) 2026 Microsoft Corporation (license).