Codeunit 18008318 EOS010 Advanced Event Subscr.

Codeunit 18008318 EOS010 Advanced Event Subscr.

Advanced Event Subscriber for Commission Management. This codeunit isolates event subscribers that are only needed when the new salesperson engine is active.

Key Features:

  • Uses Manual EventSubscriberInstance to allow dynamic binding/unbinding
  • Events are only active when the new sales engine is enabled
  • Prevents usage of legacy tables (e.g., “EOS Add. Salesperson/Purchaser”) when the new engine is active
  • Can be temporarily unbound on-demand to allow special operations (e.g., table truncate)

Purpose: This architecture serves two main purposes:

  1. Protect legacy data structures from being used when the new engine is active
  2. Allow temporary disabling of protections when needed for maintenance operations (truncate, bulk operations, etc.)

The manual binding allows these protective events to be disabled on-demand without affecting Business Central performance or blocking legitimate administrative operations.

Usage:

  • Call BindOrUnBindCodeunitIfNeeded() during setup initialization to activate/deactivate based on engine configuration
  • Call ForceUnbinding() temporarily before operations that need to bypass the protections (e.g., truncate legacy tables)
  • Re-bind after completing the special operation

EOS Labs -