Step 4 – Convert C/AL to AL with Visual Studio Code

The ForNAV standard reports are in public preview. We have just released CTP2 and now we want to start testing them with Visual Studio Code. In order to do that we have to convert them to AL objects.

Microsoft is kind enough to provide tooling which you can find on the June update for the developers preview.

https://blogs.msdn.microsoft.com/nav/2017/06/20/nav-development-preview-june-update/

The tool is a small .exe file you can find in the same folder as your finsql.exe and called txt2al.exe. It is documented on MSDN.

https://msdn.microsoft.com/en-us/dynamics-nav/newdev-txt2al-tool

The tool takes a NAV txt object but it has to be exported using the MS-DOS command prompt using a special option.

Because it is a lot to write down I’ve actually recorded a 30 minutes video and posted it on YouTube. This video shows the commands, shows the differences in beyond compare and tells you how to make the tool run, test and put it on GitHub using a folder structure that makes sense. At least in my opinion.

Here is the video

And here is the text from my Convert.Bat file

finsql.exe Command=ExportToNewSyntax, File="D:\CAL\fornav.txt", Database="Demo Database NAV (10-0)", ServerName=.\NAVDEMO, filter="ID=70000..79999", Logfile=D:\Log_ExportFile.txt

pause

txt2al --source=D:\CAL\ --target=D:\AL\ --rename --extensionStartID 70070000

pause

 

6 thoughts on “Step 4 – Convert C/AL to AL with Visual Studio Code

  1. Dheeraj Dubey

    Hi Mark,
    Thanks for this blog.
    when i try to run the bat file in command prompt. only log file has been created with below error:

    [18023703] You do not have permission to run the ‘File, Export, Text’ System.
    Contact your system administrator to have your permissions changed.

    i have already applied developer license and i can manually export the object in txt format.

    Can you please help!

    Like

    Reply
  2. Marshall

    when i convert the master table such as “Customer”, it makes AL file like it’s creating the new table meanwhile in my new navcontainer AL, table “Customer” already existed..

    how do i push all the modified code from C/AL “Customer” to AL “Customer” then? i mean it’s a lot of code there.. please help, i’m stuck here

    Like

    Reply
      1. Marshall

        Hi Mark,
        thanks for replying,, did you mean core NAV tables in AL i presume?
        and could you tell me what delta files mean?
        thanks a lot, really appreciate it man..

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s