Table of Contents
Add field in existing Table using extension In D365 BC:
Step-01:
- The table extension object allows you to add additional fields or to change some properties on a table provided by the Dynamics 365 Business Central service. Along with defining other fields, the table extension is where you write trigger code for your additional fields.
- Mandatory- Extensible Property set to true can be extended.
- Table Extension Example-
tableextension Id MyExtension extends MyTargetTable { fields { // Add changes to table fields here } var myInt: Integer; } |
Step-02:
- Open Visual Studio Code and Select “.vscode” and Add New File as shown in image.

Step-03:
- Enter the name of the extension as shown in image.

- This table extension object extends the Sales header table object by adding a field
LDClause
, with ID 50000 and the data type. - After doing the above steps. Publish the extension.
tableextension 50012 SalesHeaderExt extends “SalesHeader” { fields { field(50000; LDClause; Boolean) { trigger OnValidate(); begin if (rec.LDClause = true) then begin message(‘LD Clause Valid : %1’, rec.LDClause); end; end; } } |
