Here’s a small “let me bookmark this” post.

I often did not completely understand trigger and event sequences in AL. I sort of knew them, but I doubted myself just enough to keep going back to the documentation. It’s not like the documentation is bad, but every time it took me just a few additional minutes to figure out the answer, that I decided I wanted to visualize this.

It came in handy for me, maybe it will for you too. I’d love to hear if you’d add any other sequence!


Few things to remember that I didn’t want to jam into the visualizations

  • Apps with lower IDs execute their triggers and subscribers before those with higher IDs.
    For example, if App A has an ID like “1bs3..” and App B has “c23f..”, App A’s triggers and subscribers will always run first.
  • Within the same App, objects with lower Object IDs execute their triggers and subscribers before those with higher Object IDs
    A subscriber in Codeunit 50000 will execute before one in Codeunit 50001. Similarly, triggers in Table Extension 50000 will run before those in Table Extension 50001.
  • Subscribers in the same codeunit are executed in alphabetical order by procedure name
    For instance, a procedure named MySubscriber1 will run before MySubscriber2, regardless of their order in the code.

When looking at the Lookup flow, remember that only one OnLookup trigger can be executed at a time. Once the first one is executed, others are ignored.

I made a small trigger logger for the purpose of this post, you can find it here. It’s a simple extension that logs the trigger and event sequence to a table.


Trigger Flow Diagrams

Record Operation Triggers:
Field Operation Triggers:
flowchart TD Start --> NoChart NoChart(Click a button to display trigger flow)