The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
TRAP Method (TestPage)
Traps the next test page that is invoked and assigns it to the test page variable.
The test page variable that you use to refer to the test page.
This example shows how to use the TRAP method to trap a call to open a test page so that the opened page is assigned to a variable.
This example requires that you create the following variables.
CustomerCard.OPENEDIT; CustomerStatistics.TRAP; // The next page that is invoked will be trapped and assigned to the CustomerStatistics variable. CustomerCard."Page Customer Statistics".INVOKE; // Invokes an action from the Customer Card page. CustomerStatistics."Balance (LCY)".ASSERTEQUALS(0); // Now that the CustomerStatistics test page is open, you can use the variable to test the page.