Microsoft Dynamics 365 Business Central Cookbook
上QQ阅读APP看书,第一时间看更新

How it works...

In order to change, enhance, or modify the base application logic, we must hook into events using a subscriber. These events are placed throughout the application source code in order to make them extensible to Business Central partners and customers.

The concept of events does mean that you cannot necessarily change every little thing about the system, but it provides a much more controlled way of changing how the system works.

Any time that the event is fired in the application source code, a check is done to see whether there are any active subscribers, and, if so, that the logic in those subscribers is executed.

When multiple applications subscribe to the same event, you cannot control which application is executed first, so be careful with the code you put into a subscriber. If you are completely reliant on the data looking a certain way, you might run the risk of another application changing it and therefore breaking your logic.