Page Extension -Tenerife Visual Studio Code

In previous post Table Extension we saw how to extend table using Tenerife (New NAV development tool) .In this blog post we will see how to extend Pages using visual studio code.

The page objects extends a dynamics NAV page object .This will used for add or overrides the functionality.The structure of page is divided into three parts

  1. First part contains metadata for the entire page
  2. Second part describes visual parts on page
  3. Final Part describes action published on page

In visual studio typing tpageext will create the basic layout for page object when using AL extension in Visual Studio code.

 How to Write Code 

For example if you would like to add the custom field and Action button then you can wrtie code as follows.

pageextension

pageextension 70000030 VendorCardExtension extends "Vendor Card"
{
 layout
 {
 addlast(General)
 {
 field("Credit Days"; CreditDays)
 {
 CaptionML = ENU='CreditDays';

 trigger OnValidate();
 begin
 if CreditDays < 0 then
 Error('Credit Days Can not be blank');
 end;
 }
 }

 }

 actions
 {
 addlast(Creation)
 {
 group(MyActionGroup)
 {
 Action(MyAction1)
 {
 trigger OnAction();
 begin
 Message('Action Button is operating');
 end;
 }
 
 }
 }
 }

}

Keep Learning and Stay tuned for more updates…

Cheers…

Advertisement

4 thoughts on “Page Extension -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.