How to add or show new field in existing Page in D365 BC

Add or show new field in existing Page in D365:

Step-01:

  • The page extension object extends a Dynamics 365 Business Central page object and adds or overrides the functionality.
  • The structure of a page is hierarchical and breaks down into three sections. The first block contains metadata for the overall page; the type of the page and the source table it is showing data from. The next section; the layout, describes the visual parts on the page. The final section details the actions that are published on the page.
  • Mandatory – Only pages with the Extensible Property set to true can be extended.

Step-02:

  • Open Visual Studio Code and Select “.vscode” and Add New File as shown in image.
new file in vs code

Step-03:

  • Enter the name of the extension as shown in image.
name of extension in vs code

Step-04:

In the following example, we use a table extension to extend the Sales Header table with a new field named LDClause of the data type Boolean. Then we create a page extension object that extends the Sales Order page object by adding a field control LDClause to the General group after the Posting Date field on the page.

extend the Sales Header table with a new field
pageextension 50002 CustomerCardExtension extends “Sales Order”
{
layout
{
// Adding a new control field ‘LDClause’ in the group ‘General’ after “Posting Date” field.
addAfter(“Posting Date”)
{
field(“LDClause”; LDClause)
{
Caption = ‘LD Clause’;
trigger OnValidate(); begin if LDClause = True then Error('Validate the Code'); end; } } }

How to add field in existing Table using extension In D365 BC
How to Install AL code extension in VS Editor
How to configure GST Setup in Dynamics 365 BC
Create and work with custom fields– Microsoft Docs

Leave a Reply