The following screenshot shows page triggers. The Help section's Page and Action Triggers provides good general guidance to the events that cause each page trigger to fire. Note that the OnQueryClosePage trigger isn't related to any query object action:
In general, according to best practices, we should minimize the AL code placed in page triggers, putting code in a table or field trigger or calling a codeunit library function instead. However, many standard pages include a modest amount of code supporting page-specific filter or display functions. When we develop a new page, it's always a good idea to look for similar pages in the standard product and be guided by how those pages operate internally. Sometimes, special display requirements result in complex code being required within a page. It is important that the code in a page be used only to manage the data display, not for data modification.
To execute AL code in pages, you can also use events. Each...