Page object definition

A page object is the user interface for your users in Dynamics 365 Business Central. You can define a page object in AL using the tpage snippet:

The first three options allow you to create the following page types:

  • Card page
  • API page
  • List page

A Card page (the first option) is defined as follows:

page Id MyPage
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Administration;
SourceTable = TableName;

layout
{
area(Content)
{
group(GroupName)
{
field(Name; NameSource)
{
ApplicationArea = All;
}
}
}
}

actions
{
area(Processing)
{
action(ActionName)
{
ApplicationArea = All;
trigger OnAction()
begin

end;
}
}
}

var
myInt: Integer;
}

A Card page is identified by its ID and its name (both of which must be unique inside the application). A page also has its own properties. The main things to define are as follows:

  • PageType: Identifies the type of the page.
  • SourceTable: Sets the underlying table for this page.
  • SourceTableView: Sets the key, sort order, and filter you want to use to determine the view of the source table presented to the user.
  • ApplicationArea: Sets the visibility of the page inside the Business Central application. The standard values are All, Basic, Suite, and Advanced.
  • UsageCategory: Sets the Departments column for the searched page in the web client.
  • ExtensibleSets whether the object can be extended or not.

A page has a layout (which defines the page appearance in the UI) and an actions section (which defines the available menu items for adding code actions inside a page). Inside the layout, you have a content area, which contains a set of groups, and every group can contain one or more page fields. You can add a field inside a page group by using the tpagefield snippet:

field(MyField; FieldSource)
{
ApplicationArea = All
FieldPropertyName = FieldPropertyValue;
}

A field on a page is defined by a name (the field keyword inside the page) and a field source (the source expression of the page field, which corresponds to the physical fields defined in the underlying table).

A field can have its own properties and it must have an ApplicationArea set.

A List page (the third option) is defined as follows:

page Id PageName
{
PageType = List;
ApplicationArea = All;
SourceTable = TableName;

layout
{
area(Content)
{
repeater(Group)
{
field(Name; NameSource)
{
ApplicationArea = All;

}
}
}

area(Factboxes)
{

}
}

actions
{
area(Processing)
{
action(ActionName)
{
ApplicationArea = All;

trigger OnAction();
begin

end;
}
}
}
}

A List page has the PageType property set to List and the layout section has a Content area and a FactBox area. The Content area has a repeater group, which contains all the fields you want to display on that list. After that, you have the actions section.

If your page contains a repeater control (for example, a List page), you can define actions that apply to the entire page or to the repeater control itself (a single record). For this, the action has a property called Scope, which can be defined as a page (the action is at the page level) or a repeater (the action is at the record level).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.115.195