Create Table Extension with Tenerife-Visual Studio Code

At the moment Microsoft development tool is still evolving and getting updated day by day.

In this blog post we will see how how to create Table extension object.

The table extension allows you to add more fields or change properties on a table. Along with defining other fields,the table extension is where you can write trigger code for additional fields.

In visual studio code by typing ttableext will create basic layout for table extension object when using AL extension in Visual Studio code.

Following properties can be changed for table

  1. Width
  2. OptioncaptionML
  3. Description
  4. ClosingDates

How to Write Code 

For example now if you would like to add one field in table and write some validation on that field then you can write as follows. In this I am adding field in Table 23 Vendor as Credit Days with datatype Integer.

tableextension 70000030 CreditDays extends Vendor
{
fields
{
field(70000900;CreditDays;Integer) 
{
trigger OnValidate();
begin
if (rec.CreditDays < 0) then
begin
message('Credit Days can not be blank');
end; 
end;
}
}
}

Stay tuned for more and Keep updating and learning .

Cheers

Advertisement

3 thoughts on “Create Table Extension with Tenerife-Visual Studio Code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.