Blog

Blog

Simple C/AL to AL conversion Dynamics Business Central

Posted on 18-Oct-2018 by Manish Sharma

BREIF :

Converting dynamics nav addon solutions to Al using, Command Prompt & Development Shell.

DEPENDENCIES :

Dynamics NAV 2018 Client.

Dynamics Business Central Client.

Dynamics Business Central Development Shell.

NEXT :

Export all addon objects from your current dynamics nav 2016 as a text file.

Import those objects in dynamics nav 2018 using the development environment.

Open command prompt in elivated mode and export these objects using below command :  “C:\Program Files (x86)\Microsoft Dynamics NAV\110\RoleTailored Client\finsql.exe” Command=ExportToNewSyntax, File=”E:\D365BC\CAL\Table_CAL.txt”,Database=”Demo Database NAV (11-0)”,ServerName=.\NAVDEMO,Filter=Type=Table;ID=FromID..ToID.                   

Note : You need to export all types of objects in text (i.e. Table as one text file, Pages as on text file).

Once you have export all these objects we need to split them in a single text file for each object, cause Txt2Al.exe converts single object file to AL type. If try to convert a single file with multiple objects only the last object in the file gets converted to AL.

We shall use the development shell for splitting the objects that we have exported for AL. Open dynamics nav development shell and execute the split command as Split-NAVApplicationObjectFile -Source “E:\D365BC\CAL\*.txt” -Destination “E:\D365BC\CAL\”. This will split objects in multiple single files.

Above files have been created using Split-NAVApplicationObjectFile from Table.txt & Pages.txt.

Now we shall convert these file in AL format, for this we shall use the command prompt : “C:\Program Files (x86)\Microsoft Dynamics 365 Business Central\130\RoleTailored Client\Txt2Al.exe” –source “E:\D365BC\Addon\CAL” –target “E:\D365BC\Addon\AL”

Above screen shows the details of the conversion.

Once the conversion is completed with zero error, you can use these AL file for you extensions.

Open visual studio code and open the folder containing the converted AL objects to see the conversion.

ERROR YOU MIGHT ENCOUNTER :

Sourcetable in page will be having the table no., you need to type in the correct table name.

Other Error are of missing double quotes for field as shown below, add those double quotes and move on to next error.

Once all the error are corrected you can build the solution for a final check if the package is created. Once the package is sucessfully created you are good to publish your extension.

Share


Post a Comment

Your email address will not be published. Required fields are marked (*)

Captcha
can't read? refresh

WhatsApp Now