Creating Page Document

Build Document pages with header fields and a lines subpage for order-style interfaces.

35 minIntermediate

Learning Objectives

  • Create Document pages with header and lines
  • Build Part pages for line items
  • Link header and lines with SubPageLink
  • Handle document workflows

Document Pages

Document pages combine a header record with line items — the pattern used for Sales Orders, Purchase Invoices, and journals.

Header Page

BonusDocument.Page.al
page 50102 "Bonus Document"
{
    PageType = Document;
    SourceTable = "Bonus Header";

    layout
    {
        area(Content)
        {
            group(General)
            {
                field("No."; Rec."No.") { }
                field("Customer No."; Rec."Customer No.") { }
                field("Document Date"; Rec."Document Date") { }
            }
            part(Lines; "Bonus Subform")
            {
                SubPageLink = "Document No." = field("No.");
            }
        }
    }
}

Lines Subpage

BonusSubform.Page.al
page 50103 "Bonus Subform"
{
    PageType = ListPart;
    SourceTable = "Bonus Line";
    AutoSplitKey = true;

    layout
    {
        area(Content)
        {
            repeater(Lines)
            {
                field("Line No."; Rec."Line No.") { Visible = false; }
                field(Description; Rec.Description) { }
                field(Amount; Rec.Amount) { }
            }
        }
    }
}

AutoSplitKey

AutoSplitKey = true automatically creates a new line when the user tabs past the last field — standard BC behavior users expect.

Next Steps

Add actions to make your pages interactive and professional.

Open Source

Help improve this platform

NAVBC Learning is open source. Report issues, suggest improvements, or join discussions on GitHub.