Link pages with page parts

Completed

Page parts are used on FactBoxes and document pages for displaying extra information about the current selected record. For example, on a customer card, you can display the latest purchases in a FactBox or display them as a part of the total number of unpaid invoices.

On a document page, page parts are typically used for displaying the lines. On a sales document, the Document page is linked to the Sales Header table and a page part, which displays all invoice lines from the Sales Lines table.

Screenshot showing a screen and the Page Parts that make up the page.

To define a part on a page, use the tpart snippet. A part has the following structure:

part(PartName; PartSource)

Your first task is to define the name of the control on the page. Next, provide the name of the page that should be loaded in the page part. The page name is the name of a ListPart or CardPart, as demonstrated in the following screenshot.

Screenshot of the coding for a Page part in AL.

Two important properties that are used on page parts are SubPageLink and SubPageView.

The SubPageLink links the main page and page part. On the page, part details are shown from the record on the main page. You can link one or multiple fields from the table on the main page with fields in the table on the page part. You can also apply additional filters and sorting by using the SubPageView.