In the following walkthrough, you enable C/SIDE to receive events from the Dynamics NAV Communication Component. The Dynamics NAV Communication Component and the bus adapter are installed as part of the NAV Application Server. These two components must be installed before you can implement the following example.

C/SIDE can receive events from the components (automation servers and OCXs) that it controls. When you declare a global variable of data type Automation, you can specify whether you want to receive events. You do so by setting the WithEvents property for the variable to Yes. This automatically generates AL triggers for the events that the component provides. A trigger name consists of the name of the automation variable followed by "::<Event name>." For example, if you declare an automation variable with the name MyEventVar, and the component provides the event MessageReceived(...), the name of the trigger is MyEventVar::MessageReceived(...).

Expand imagePrerequisites

Expand imageReceiving Notification of Inbound Documents

Expand imageCreating a Codeunit and Declaring the Variables

Expand imageSetting the WithEvents Property

Expand imageEvent Triggers

Expand imageSee Also