How to handle CodeUnit 1 Logic in Business Central upgrade

15

As you all are aware that Codeunit 1 (Application Management) has been removed and it is replace with new system codeunits. By moving this there is no functionality changes but this process will affect upgrade process for NAV.

All these functions has been changed  to different event including publishers and subscribers that means instead of calling Codeunit 1 functions business central will use system codeunits.

Following tables will illustrate mapping between codeunit 1 triggers and event publishers.

Codeunit 1 trigger
New Codeunit ID
New method
CompanyClose
LogInManagement
CompanyClose
CompanyOpen
LogInManagement
CompanyOpen
GetSystemIndicator
LogInManagement
GetSystemIndicator
OnAfterCompanyClose
LogInManagement
OnAfterCompanyClose
OnAfterCompanyOpen
LogInManagement
OnAfterCompanyOpen
OnBeforeCompanyClose
LogInManagement
OnBeforeCompanyClose
OnBeforeCompanyOpen
LogInManagement
OnBeforeCompanyOpen
FindPrinter
ReportManagement
GetPrinterName
ApplicationVersion
Application System Constants
ApplicationVersion
CustomApplicationVersion
N/A
N/A
ReleaseVersion
Application System Constants
ReleaseVersion
ApplicationBuild
Application System Constants
ApplicationBuild
CustomApplicationBuild
N/A
N/A
ApplicationLanguage
LanguageManagement
ApplicationLanguage
DefaultRoleCenter
Conf./Personalization Mgt.
DefaultRoleCenterID
MakeDateTimeText
TextManagement
MakeDateTimeText
GetSeparateDateTime
TextManagement
GetSeparateDateTime
MakeDateText
TextManagement
MakeDateText
MakeTimeText
TextManagement
MakeTimeText
MakeText
TextManagement
MakeText
MakeDateTimeFilter
TextManagement
MakeDateTimeFilter
MakeDateFilter
TextManagement
MakeDateFilter
MakeTextFilter
TextManagement
MakeTextFilter
MakeCodeFilter
TextManagement
MakeTextFilter
MakeTimeFilter
TextManagement
MakeTimeFilter
AutoFormatTranslate
AutoFormatManagement
AutoFormatTranslate
ReadRounding
AutoFormatManagement
ReadRounding
CaptionClassTranslate
CaptionManagement
CaptionClassTranslate
GetCueStyle
Cue Setup
GetCueStyle
SetGlobalLanguage
LanguageManagement
SetGlobalLanguage
ValidateApplicationlLanguage
LanguageManagement
ValidateApplicationLanguage
LookupApplicationlLanguage
LanguageManagement
LookupApplicationLanguage
GetGlobalTableTriggerMask
GlobalTriggerManagement
GetGlobalTableTriggerMask
OnGlobalInsert
GlobalTriggerManagement
OnGlobalInsert
OnGlobalModify
GlobalTriggerManagement
OnGlobalModify
OnGlobalDelete
GlobalTriggerManagement
OnGlobalDelete
OnGlobalRename
GlobalTriggerManagement
OnGlobalRename
GetDatabaseTableTriggerSetup
GlobalTriggerManagement
GetDatabaseTableTriggerSetup
OnDatabaseInsert
GlobalTriggerManagement
OnDatabaseInsert
OnDatabaseModify
GlobalTriggerManagement
OnDatabaseModify
OnDatabaseDelete
GlobalTriggerManagement
OnDatabaseDelete
OnDatabaseRename
GlobalTriggerManagement
OnDatabaseRename
OnDebuggerBreak
Debugger Management
ProcessOnDebuggerBreak
LaunchDebugger
Debugger Management
OpenDebugger
OpenSettings
Conf./Personalization Mgt.
OpenSettings
OpenContactMSSales
SaaS Log In Management
OpenContactMSSales
InvokeExtensionInstallation
ExtensionMarketplaceMgmt
InvokeExtensionInstallation
CustomizeChart
Generic Chart Mgt
CustomizeChart
HasCustomLayout
ReportManagement
HasCustomLayout
MergeDocument
ReportManagement
MergeDocument
ReportGetCustomRdlc
ReportManagement
ReportGetCustomRdlc
ReportScheduler
ReportManagement
ScheduleReport
OnBeforeOpenSettings
Conf./Personalization Mgt.
OnBeforeOpenSettings
OnAfterGetApplicationVersion
Application System Constants
OnAfterGetApplicationVersion
OnRoleCenterOpen
Conf./Personalization Mgt.
OnRoleCenterOpen
OnAfterGetSystemIndicator
Sales-Post and Send
OnAfterGetSystemIndicator
OnAfterFindPrinter
ReportManagement
OnAfterGetPrinterName
OnAfterGetDefaultRoleCenter
Conf./Personalization Mgt.
OnAfterGetDefaultRoleCenter
OnAfterMakeDateText
N/A
N/A
OnAfterMakeTimeText
N/A
N/A
OnAfterMakeText
N/A
N/A
OnAfterMakeDateTimeFilter
TextManagement
OnAfterMakeDateTimeFilter
OnAfterMakeDateFilter
TextManagement
OnAfterMakeDateFilter
OnAfterMakeTextFilter
TextManagement
OnAfterMakeTextFilter
OnAfterMakeCodeFilter
N/A
N/A
OnAfterMakeTimeFilter
TextManagement
OnAfterMakeTimeFilter
OnAfterAutoFormatTranslate
AutoFormatManagement
OnAfterAutoFormatTranslate
OnAfterCaptionClassTranslate
CaptionManagement
OnAfterCaptionClassTranslate
OnAfterGetGlobalTableTriggerMask
GlobalTriggerManagement
OnAfterGetGlobalTableTriggerMask
OnAfterOnGlobalInsert
GlobalTriggerManagement
OnAfterOnGlobalInsert
OnAfterOnGlobalModify
GlobalTriggerManagement
OnAfterOnGlobalModify
OnAfterOnGlobalDelete
GlobalTriggerManagement
OnAfterOnGlobalDelete
OnAfterOnGlobalRename
GlobalTriggerManagement
OnAfterOnGlobalRename
OnAfterGetDatabaseTableTriggerSetup
GlobalTriggerManagement
OnAfterGetDatabaseTableTriggerSetup
OnAfterOnDatabaseInsert
GlobalTriggerManagement
OnAfterOnDatabaseInsert
OnAfterOnDatabaseModify
GlobalTriggerManagement
OnAfterOnDatabaseModify
OnAfterOnDatabaseDelete
GlobalTriggerManagement
OnAfterOnDatabaseDelete
OnAfterOnDatabaseRename
GlobalTriggerManagement
OnAfterOnDatabaseRename
OnAfterHasCustomLayout
ReportManagement
OnAfterHasCustomLayout
OnAfterReportGetCustomRdlc
Edit MS Word Report Layout
OnAfterReportGetCustomRdlc
OnBeforeOnDatabaseInsert
GlobalTriggerManagement
OnBeforeOnDatabaseInsert
OnBeforeOnDatabaseModify
GlobalTriggerManagement
OnBeforeOnDatabaseModify
OnBeforeOnDatabaseDelete
GlobalTriggerManagement
OnBeforeOnDatabaseDelete
OnBeforeOnDatabaseRename
GlobalTriggerManagement
OnBeforeOnDatabaseRename
OnEditInExcel
ODataUtility
OnEditInExcel
OnInstallAppPerDatabase
N/A
N/A
OnInstallAppPerCompany
N/A
N/A
OnCheckPreconditionsPerDatabase
Data Upgrade Mgt.
OnCheckPreconditionsPerDatabase
OnCheckPreconditionsPerCompany
Data Upgrade Mgt.
RaiseOnCheckPreconditionsPerCompany
OnUpgradePerDatabase
Data Upgrade Mgt.
OnUpgradePerDatabase
OnUpgradePerCompany
Data Upgrade Mgt.
OnUpgradePerCompany
OnValidateUpgradePerDatabase
Data Upgrade Mgt.
OnValidateUpgradePerDatabase
OnValidateUpgradePerCompany
Data Upgrade Mgt.
OnValidateUpgradePerCompany

Hope this helps you

 

 

 

 

 

 

 

Advertisement

User and Workspace Settings in Visual Studio Code

I hope you already started working with Visual studio code.

In this section we will see how to do setting for User and workspace in Visual Studio code environment.

It is easy to configure visual studio code as per your likings using various settings. You can change VS code editor ,user interface and functioning by using this settings

There are three ways you can open user and workspace settings

  1. To access you can go to  Click on File–>Preferences–>Settings

User1user2

2) Using Command Palette(Ctrl+Shift+P)  by typing

Preferences: Open User Settings  or Preferences : Open Workspace Settings

user3

3) Use keyboard shortcut (Ctrl+,)

This provides two different settings

  • User Settings – Settings that apply globally to any instance of VS Code you open.
  • Workspace Settings – Settings stored inside your workspace and only apply when the workspace is opened.

Workspace settings override user settings.

How to create user settings 

Once you open settings then you can modify settings as below

Example. If I want to change font size in editor then I can do it from here

 

Change the font size and see the effect on editor.

user6

It shows the effect immediately after saving the file.

Same kind of settings you can do it for AL language extension management

user7These changes get saved in %APPDATA%\Code\User\settings.json

Hope this will help you while extension development

Stay tuned for more…

Cheers…

 

 

 

 

Setup Visual Studio Code for local NAV server Installation

In this section we will see how do we setup Visual studio code locally on NAV 2018 server.

Hereby I assume that NAV 2018 is already installed on local machine .

You can download Visual studio code from Visual Studio Code

After Installing NAV 2018 and Visual Studio Code follow following steps to enable Visual studio code for writing extension and AL code.

  1. Enable Developer Service endpoint from NAV server instance

Developer End Point

2) Setup Web Client Base URL

Mention the web client url address .for example :- http://localhost:8080/dynamicsnav110/

WebClientURL

Once all changes done in service then restart the service.

3) Open Visual studio code and Install VSIX file from media 

InstallVSIX

You will find .vsix file in NAV 2018 Media file in folder ..\NAV.11.0.22292.W1.DVD\ModernDev\program files\Microsoft Dynamics NAV\110\Modern Development Environment\ALLanguage.Vsix

This will install AL language in visual studio code

4) Press CTRL+SHIFT+P and select command AL:GO in order to select a location and create a folder with default file of an extension

5) Setup Launch .JSON file

JSOn

Change server instance to DynamicsNAV110 and authentication to Windows

6) Press CTRL+SHIFT+P  and use command to download symbols AL:Download Symbols

7) Pres CTRL+F5 to publish the Helloworld.AL extension which extends customer list page and same id is mention in startupobjectid parameters of launch .json file

AL1

Once publish you will get following in web client

2

Get ready for extension development with this….

Cheers…

 

 

 

 

February Update for NAV Development Tool

As the NAV development tool getting updated every day based on the issues reported on GitHub and MS team is continuously updating the development tool

Refer following link for update for this month

https://blogs.msdn.microsoft.com/nav/2017/02/16/nav-development-tools-preview-february-update/

 

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…

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