One of the best tools to figure out what events are firing is the Event Recorder. In this video, I showcase the Event Recorder and demonstrate how to use it:

Finding the right event to subscribe to in Business Central can be one of the more time-consuming parts of AL development. You might know exactly what process you want to tap into, but locating the specific event that fires at the right moment requires digging through code, documentation, or source symbols. In this video, Erik demonstrates a built-in tool called the Event Recorder that makes this discovery process significantly easier by recording every event that fires during a business process, then letting you filter and browse the results.
What Is the Event Recorder?
The Event Recorder is a page built into Business Central that captures all events — both custom and trigger-based — that fire while you perform actions in the system. Think of it as an event log that records everything happening under the hood during a business process. Once you stop recording, you get a full list of events you can filter, inspect, and even export as AL code snippets.
How to Use the Event Recorder
Step 1: Open the Event Recorder
In Business Central, use the search bar (Alt+Q) and search for “Event Recorder”. This opens the Event Recorder page. Erik notes that the action bar buttons aren’t promoted by default, which means you might want to pin them for easier access — a minor UI gripe, but worth noting.
Step 2: Start Recording
Click Start Recording, then navigate to the process you want to investigate. The key here is to take the most direct path possible — avoid unnecessary detours through other pages, as every page you touch will generate additional events and noise in your recording.
For example, if you want to see what events fire when posting a sales order:
- Click Start Recording
- Use Alt+Q to go directly to Sales Orders
- Open the order you want to post
- Post it (Ship and Invoice, or just Ship — depending on what you’re investigating)
- Navigate back to the Event Recorder
- Click Stop Recording
Step 3: Review the Results
Even posting a single sales order can generate a staggering number of events. In Erik’s demonstration, a full Ship and Invoice post recorded 2,856 events, while shipping alone recorded 781 events. This is where filtering becomes essential.
Filtering the Event List
The Event Recorder captures two types of events:
- Custom Events — Events explicitly raised in application code (business logic events)
- Trigger Events — Events that fire from table and page triggers (OnBeforeDelete, OnAfterInsert, OnAfterGetCurrRecord, OnNewRecord, etc.)
Start by filtering the Event Type column to show only Custom events. This immediately reduces the list dramatically, cutting out all the table and page trigger noise.
From there, you can add additional filters. For instance, you’ll likely see many events from objects like Error Message Management or Graph Management that aren’t relevant to your investigation. Filter the Calling Object Name column to exclude these:
- Filter out “Error Message Management”
- Filter out “Graph Management” or other irrelevant objects
As you narrow the list, you’ll start to see the process unfolding in sequence — almost like reading a story of what happened. You can observe events like:
OnAfterReleaseSalesDocin the Release Sales Document codeunitOnAfterSalesShipmentHeaderInsertOnBeforeSalesInvoiceHeaderInsert- Reservation and item tracking events
Generating an AL Snippet
Once you’ve found the event you need, the Event Recorder provides a Get AL Snippet action. Clicking this generates a ready-to-use event subscriber declaration that you can copy directly into Visual Studio Code.
In Erik’s example, he located the event OnAfterCopyTrackingFromItemLedgEntry on the Reservation Entry table — an event you’d need if you wanted to transfer custom field values between item ledger entries and reservation entries during posting. After clicking Get AL Snippet and pasting it into VS Code, the result looks like this:
codeunit 50103 "Subscribers"
{
[EventSubscriber(ObjectType::Table, Database::"Reservation Entry", 'OnAfterCopyTrackingFromItemLedgEntry', '', true, true)]
local procedure MyProcedure(ItemLedgerEntry: Record "Item Ledger Entry"; var ReservationEntry: Record "Reservation Entry")
begin
ReservationEntry.ournewfield := ItemLedgerEntry.ournewfield;
end;
}
The snippet gives you the full event subscriber attribute with the correct object type, object ID, and event name. All you need to do is fill in the parameters and write your business logic.
Another Example: Subscribing to Release Sales Document Events
The Event Recorder is also how you might discover events on codeunits like Release Sales Document. Here’s an example of subscribing to events found through the recorder on that codeunit:
codeunit 50112 "Event Recorder Demo"
{
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Release Sales Document", 'OnBeforeReleaseSalesDoc', '', true, true)]
local procedure OnBeforeReleaseSalesDoc(var SalesHeader: Record "Sales Header"; PreviewMode: Boolean)
begin
if PreviewMode then
exit;
if Date2DWY(SalesHeader."Posting Date", 1) = 7 then
error('No posting dates on a Sunday!');
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Release Sales Document", 'OnBeforeOnRun', '', true, true)]
local procedure MyProcedure()
begin
end;
}
This demonstrates how events discovered through the recorder can be used to add custom validation logic — in this case, preventing sales documents from being released with a Sunday posting date.
Watch Out for the Filter Bug
Erik discovered an interesting bug during the recording: if you have active filters on the event list and click Start to begin a new recording, the recorder only clears the events that match your current filter. Events outside the filter remain, which means your next recording will show a mix of old and new data.
The workaround is simple: always clear your filters before clicking Start on a new recording session.
Pro Tip: Use It for Remote Collaboration
One particularly clever use case Erik shares is using the Event Recorder when collaborating with consultants or end users remotely. If you need to understand a customer’s specific business process but aren’t entirely sure what steps they take, you can ask them to:
- Open the Event Recorder
- Click Start
- Perform their business process as they normally would
- Click Stop
- Copy all the output into an Excel sheet and send it to you
This gives you a complete picture of what’s happening in the system during their process, letting you identify exactly where you can interject custom code — even without having direct access to their environment at that moment.
Summary
The Event Recorder is a powerful and underutilized tool for AL developers working with Business Central. It eliminates much of the guesswork involved in finding the right event to subscribe to by giving you a real-time log of every event that fires during a process. Combined with filtering capabilities and the built-in AL snippet generator, it can dramatically speed up your development workflow. Just remember to keep your recordings focused by taking the most direct path through a process, and always clear your filters before starting a new recording session.