How to Show Hide Fields - Muhammad-Ali-Mughal/Microsoft-Dynamics-BC-AL-Extension GitHub Wiki

How to show and hide fields in a page?

At this requirement, our mind first jumps to create this functionality custom, but this is provided in Business Central by default. This only requires one property in the field.

Importance

Importance property of the field defines that will it be showed on page open. This property may be Standard, Promoted, Optional, and Additional. To hide a field, just set this property to Additional and it will pop up a button at group level "Show More"/"Show Less".

Syntax of Hiding Fields

page 50101 "Cronus Course Card Page"
{
    PageType = Card;
    ApplicationArea = All;
    UsageCategory = Administration;
    SourceTable = "CRONUS Course";


    layout
    {
        area(Content)
        {
            group("My Group Name")
            {
                Caption = 'Group';
                field("Post Code"; Rec."Post Code")
                {
                    ApplicationArea = All;
                    Importance = Additional;
                }
                field(Country; Rec.Country)
                {
                    ApplicationArea = All;
                    Importance = Additional;

                }
            }
        }
    }
}