Skip to main content

How to upgrade Microsoft Dynamics NAV C/AL Objects to Microsoft Dynamics Business Central AL Objects


When migrating from NAV 2017 to NAV 2018 i.e moving from C/AL to AL the created objects need not be created again from scratch in AL. This blog demonstrates how we can create the AL objects from C/AL using Txt2Al in Command Prompt.


  1. NAV 2018.
  2. Backup of Objects in TEXT or FOB format.


1. Import objects in NAV 2018 from the created  .TXT or .FOB files.

In NAV Development Environment goto,

Files > Import > Choose the .FOB or  .TXT file > Replace all the objects

2. Export the objects in New Syntax to .TXT files.

  • Create a directory to store the objects in .TXT format which will be exported as new syntax. Here, ‘source’ is the name of the directory used.
    Use  ‘mkdir source ‘
  • Create a directory to store the .AL that will be created by TXT2AL Converter utility. Here ‘target’ is the name of the directory used.
    Use ‘mkdir target’
  • To export the objects in .TXT format in NewSyntax use the following command

    where Source Directory = ‘source’
    Filename = ‘CU0-5.txt’
    Database Name = ‘Demo Database NAV (11-0)’
    SQL Server Instance = ‘.\NAVDEMO’
    Type of Object = ‘codeunit’
    ID = ‘50000..50005’  —-is the ID range

    Similarly, for
    Type of Object = ‘table’; ID=’50000..50005′;filename=’TAB0-5.txt’
    Type of Object = ‘page’; ID=’50000..50005′;filename=’PAG0-5.txt’
    Type of Object = ‘query’; ID=’50000..50005′;filename=’Query0-5.txt’
    Type of Object = ‘report’; ID=’50000..50005′;filename=’REP0-5.txt’
    Type of Object = ‘menusuite’; ID=’50000..50005′;filename=’MS.txt’
    Type of Object = ‘xmlport’; ID=’50000..50008′;filename=’XMLPort.txt’
    NOTE: TXT2AL requires objects exported in New Syntax

3. Generate the .AL object files using the  TXT2AL converter.

To generate the .AL file from the .TXT files from source folder, run the following command

where Source Directory = ‘source’
Target Directory = ‘target’
–rename = Used to create new .AL file per new object and give it the appropriate name of the ID and name.


Thus, in this way, we can convert the objects in C/AL to AL format. Although the conversion is not 100% perfect but, most of the redundant work can be avoided.


Popular posts from this blog

Something went wrong. An Error occurred - Error Resolution

Introduction: With the installation of NAV 2018 or BC On-premise, I have observed that when creating New Server Instance and New WebServer Instance, you will get the error 'Something went wrong. An Error occurred '. I referred to the community questions below but didn't find my resolution. Hence, I decided to write this blog. Pre-requisites: Microsoft Dynamics Business Central - On-Premise / NAV 2018 Understanding of Business Central Authentication  Books & References: Demonstration: 1. Creation of NAVServerInstance: In order to create NAVServerInstance, you can either add the Server Instance through Business Central Administration or Powershell command. Add Instance - Business Central Administration Add Insta

Setting up OAuth Authentication for Business Central Web Services / APIs

Introduction: After upgrading Business Central to version 17 (Wave2 2020), I found that there was an error telling me that WebService Key is going to be deprecated soon. Web Service Access Key is deprecated. Hence, I decided to explore and probably make it easier through this blog. Pre- requisites : Admin Access to Office 365 Admin Access to Azure Demonstration: 1. App Registration on Azure Portal: To enable OAuth authentication for any apps in Azure Active Directory, you will need to perform App Registration and set up the permissions and security details. i.) Register the App: Search for 'App Registration' on the Azure Portal. Click on New Registration Type in the App Names, Account Types and Redirect URI. Registering Application ii.) Setup API Permissions: Go to API Permissions > Add Permissions > Business Central App > Select Delegated Permissions > Select Other Permissions and Financials > Add Permissions Button. Setup API Permissions iii.) Setup Client Secr

How to Upgrade Data from Microsoft Dynamics NAV to Microsoft Dynamics Business Central On Premise - Part 2

 Introduction: Now that the first step of the problem preprocessing of the NAV Database to make it ready to be migrated to BC is done(refer Part 1 ), we can now proceed further with connecting the database in Business Central On-Premise. Pre- requisites : Microsoft Dynamics 365 Business Central Microsoft Dynamics for NAV Microsoft SQL Server Management Studio (SSMS) Powershell ISE Understand NAV to BC Upgrade Considerations -  Click here Understand Upgrade Path -  Click here Books & References: Demonstration: 1. Install Business