Export C/AL objects as AL from a database on a docker container on a remote host

That’s a mouthful, isn’t it :-)?

As you might have figured in quite some sessions, threads and posts, I’m quite fond running docker images on a remote Hyper-V on my laptop. From the moment it was described by Arend Jan, I’m using it. In my opinion, it’s a much better way to run, because Windows Server is so much better in memory management as Windows 10 is (in regards of Docker that is).


And let’s not quote Ed Stark here ;-). A disadvantage of working like this is that you have to “remote” PowerShell in two machines:

  • The dockerhost
  • The container

That why I created new PowerShell modules – just to make that a bit easier. I described it earlier this year here.


I shouldn’t tell you about the txt2al conversion tool. It’s the tool that converts txt-files to al. Obviously, this tool is part of normal the NAV environment, so after Freddy already created some functions in the navcontainerhelper to be able to use the tool from a docker host – I created my own function to do that for a remote dockerhost ;-).

I think there are two scenarios where this tool is useful:

  • The obvious: convert your app from C/AL to AL. In that case, it means you need to convert your modifications (your DELTA-files) to al … Which means you need originals/modified objects/generate deltas/convert to AL. Luckily there is a very useful commandlet in the navcontainerhelper: “Convert-ModifiedObjectsToAl”.
  • But also: why not just convert an existing object to al – as if it just to see how it would look like, or to be a starting point for you to start your own object. Like if you want to create your own version of a role center or a report.


That’s why I created the function “Export-RDHNAVApplicationObjectsAsAL” and made that part of the “CRS.RemoteNAVDockerHostHelper” module on the PowerShell Gallery.

And it turns out I use it all the time :-). Here is just one example where I can export all reports as AL.

$containerName = 'devpreview'
$Path = 'C:\Temp\Reports'
$result = Export-RDHNAVApplicationObjectsAsAL `
  -DockerHost $DockerHost `
  -DockerHostCredentials $DockerHostCredentials `
  -DockerHostUseSSL:$DockerHostUseSSL `
  -DockerHostSessionOption $DockerHostSessionOption `
  -ContainerName $containerName `
  -Path $Path `
  -extensionStartId 50000 `
  -filter 'Type=3' #All Reports


0.00 avg. rating (0% score) - 0 votes

Permanent link to this article: https://www.waldo.be/2018/08/27/export-c-al-objects-as-al-from-a-database-on-a-docker-container-on-a-remote-host/

1 ping

  1. […] Bron : Waldo’s Blog Lees meer… […]

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.