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
- First part contains metadata for the entire page
- Second part describes visual parts on page
- 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 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…
One simple question pls 🙂
Where I can get extension for editing *.al files in VS Code?
LikeLike
Check this link
https://navseenbyamol.tech.blog/2017/01/20/preview-of-development-tool-for-nav/
LikeLike