Table extension Object in Microsoft Dynamics 365 Business Central - AL programming
Dr. S. Gomathi
Microsoft MVP | MCT Community Lead | 4 X MCT | Microsoft Learn Expert | PL-100, PL-300, PL-400 ,PL-600, MB-820 | Head of L & D Atna Technologies | Asia & India Books of record holder | Published Author | Global Speaker
Using the table extension object, you can customise a table given by Dynamics 365 Business Central by adding new fields or altering existing ones. The same table can be expanded in this manner and treated as a single table. For a retail winter sports store, you might want to design a table extension, for example. On the customer table, you'd want to add a new field called "ShoeSize." Code for the customer's record can be included, as well as information on their shoes.
tableextension Id MyExtension extends MyTargetTable
{
? ? fields
? ? {
? ? ? ? // Add changes to table fields here
? ? }
? ? var
? ? ? ? myInt: Integer;
}
The keywords are bolded
you can specify the ID allocated to you (mostly between 50000 to 99999)
Replace any meaningful table name in MyExtension
Specify the existing table name in the MyTargetTable (The table which you wish to extend)
If you have any doubt, please leave a reply.
Reference: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-table-ext-object