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…


Discover more from Business Central | AL Development | SaaS Upgrade | API Integration

Subscribe to get the latest posts sent to your email.

4 responses to “Page Extension -Tenerife Visual Studio Code”

  1. […] Pages using visual studio code. The page objects extends a dynamics NAV page object .This will used …read more Read Complete Post and Comments Tags: NAV 2017 New Development Tool Tenerife Visual Studio Code […]

  2. Bashtannikov Igor Avatar

    One simple question pls 🙂
    Where I can get extension for editing *.al files in VS Code?

  3. […] Page Extension -Tenerife Visual Studio Code. More… […]

Leave a Reply

237,697 hits

Discover more from Business Central | AL Development | SaaS Upgrade | API Integration

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from Business Central | AL Development | SaaS Upgrade | API Integration

Subscribe now to keep reading and get access to the full archive.

Continue reading