Using Event Recorder to discover events in Business Central20-11-2024 |
You subscribe to events to extend application and interact with the base application and other extensions. Using Event Recorder, you can record the events that are published and raised while performing the actions. Like you can record the events raised when you post a purchase order and identify the events that you need for your extension. You can copy the events in the form of AL snippet code and use them in your AL file in Visual Studio Code directly. You can launch the event recorder session from Business Central. It can be accessed in the following two ways:
Please note that the event recorder captures all events that are raised in the same session. If the actions performed by the user are in another session, the event recorder will not capture them. How to record events The below steps describe how to record events when you are on the Event Recorder page. 1.On the Event Recorder page, in the upper right corner, choose Open this page in a new window. 2.Then on the Event Recorder page, choose Record Events, and then choose the Start button. 3.In the original window, perform the actions that you want to record while the event recorder session is on. Let us post a purchase order. 4.After you have posted the purchase order, go back to the window that has the Event Recorder page open and select the Stop button to finish recording.
5.Choose Get AL Snippet to get the event subscription code in AL. You can copy and paste the AL snippet code in Codeunits to subscribe to those events. Please note that the recorded events are not saved and when you refresh the page, the recorded events vanish. All the recorded events display in the order they were called. The Event Recorder page provides information on the events that were raised including the details whether the raised events were trigger events or custom events. The custom events are either Business Events or Integration Events, additionally, you can discover which object types and methods raised the events with the details like calling methods, object types and object names. |