Page Triggers

The following screenshot shows the page triggers. The Help section's Page and Action Triggers provides good general guidance to the event which causes each page trigger to fire. Note that the On Query Close Page trigger isn't related to any Query object action:

In general, according to best practices, we should minimize the C/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 C/AL code in pages you can also use Events. Each page object automatically generates events that you can subscribe to. Using events is preferred when adding code to page objects shipped by Microsoft to avoid any merge challenges when Microsoft changes the page in a new release. You can read more about Page Events in MSDN at https://msdn.microsoft.com/en-us/library/mt299406(v=nav.90).aspx#PageEvents.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.252.8