The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
LAST Method (TestPage)
Sets the current row of the test page as the last row in the dataset.
OK := TestPage.LAST
The test page variable that you use to refer to the test page.
Property Value/Return Value
true if a record exists in the dataset and the current row was successfully set to the last row in the dataset; otherwise, false.
If TestPage is closed or has never been opened, then the method call fails.
The LAST method loops over all records until it sets the identifies the current record. For each record, the OnAfterGetCurrentRecord Trigger is executed.
This example sets the current row to the last customer in the dataset. It requires that you create a TestPage variable named CustomerList with a Subtype of Customer List.
CustomerList.OPENVIEW; CustomerList.LAST; MESSAGE(CustomerList.Name.Value);