In all examples of event subscription developed in the current chapter so far, subscription is registered statically at compile time. As soon as the event subscriber codeunit is saved and compiled, it starts to receive event notifications.
Subscription binding can also be controlled from the application code at runtime, so that the subscriber can start and stop subscriptions dynamically.
In this recipe, we will modify the codeunit 50904
Custom Integration Event from the Creating custom events recipe to control the subscription state from the UI.