How it works...

There are five steps that need to be done in order to convert CAL objects to AL files:

  1. Export all unmodified CAL objects (text format, using a new syntax).
  2. Export modified CAL objects (text format, using new syntax).
  3. Remove all unmodified objects that have not been modified.
  4. Generate delta files based on the unmodified and modified object files (using new syntax).
  5. Convert the delta files to AL files.

The delta files are used to identify what changes were made to the original CAL objects, and those changes are brought over to the AL files. The process results in a set of AL files that represent any new objects that were created, and a set of AL files that represent changes made to the base objects. The latter set are converted into page and table extension files. 

In the final step of the conversion process, you can set the starting ID number that will be used for any new AL extension files that need to be created. Ideally, you would set this according to either your Independent Software Vendor (ISV) range or the custom range that the customer has access to. Any CAL object that is converted to a non-extension AL file (such as a table, page, or report), is converted using the object ID from the CAL object.

The actual CAL to AL conversion is done using a tool called Txt2Al. This is a command-line tool that evaluates delta files and turns them into AL files. If you dig into the source code behind the Convert-Txt2Al command we used in the final step of the conversion process, you'll see that it ends up calling the Txt2Al tool. 

Although not required, using NavContainerHelper provides an easy way to create the environments for both the old (source) and new (destination) versions needed for your conversion. You can use local installations, but the commands that you need to execute will differ, as you are unable to use NavContainerHelper without containers. For example, the command to export all base objects to text in the new syntax would be similar to this:

finsql.exe Command=ExportToNewSyntax, File=C:\Temp\Objects.txt, Database="Cronus", ServerName=Localhost

Once the conversion has completed, you can simply drop the resulting AL files into an AL project and make adjustments when necessary.