The Navision Side

Inside Navision, a developer can define the conditions that should raise events.

This is done by creating a business entity. A business entity is a document that represents some Navision data. While most data in Navision that represents real-world objects, such a sales order or a Bill of Materials (BOM), is stored internally in several tables, a business entity ties everything together in one object that more closely represents what the object looks like in the real world.

This document is created as an XMLport in Navision. For example, a BOM business entity would include fields that identify the BOM, as well as fields that describe the change to the BOM.

Furthermore, the developer adds an event to the XMLport. An event on an XMLport is like a function, but without a function body. When it is called (and it is called just like a regular function) the XMLport is serialized and sent to Business Notification.

An event belongs to one business entity. For example, for a business entity called "BOM," there can be an event called "BOM changed." In fact, one business entity can have several events attached. The BOM could also have an event called "BOM made inactive." These events would, of course, be raised in different situations.

When an event has been added, the developer can decide which conditions in the Navision business logic should raise the event. In the case of the BOM change, the developer would test a BOM against the previous version whenever it is saved. If one or more fields that are important have changed, he would create an instance of the XMLport,  and make the C/AL call that raises the event. This will cause a document to be sent to Business Notification.