O'Reilly logo

Extending Microsoft Dynamics NAV 2016 Cookbook by Alexander Drogin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Subscribing to events in runtime

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.

How to do it...

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.

  1. Start the recipe from creating a new codeunit in NAV object designer.
  2. Open codeunit properties. To do this, press Shift + F4 , or choose the option Properties ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required