How to Convert Objects from C/AL to AL ?
The Txt2Al conversion tool allows you to take C/AL objects, which were created in Dynamics NAV or Business Central Spring 2019 (version 14), and convert them into the new .al format.
- Exporting the objects from C/SIDE in a cleaned .txt format.
- Converting the objects to the new syntax.
The .al format is used when developing extensions for Dynamics 365 Business Central.
Converting the objects consists of following two steps:
Exporting the objects from C/SIDE in a cleaned .txt format
We need to run the Dynamics BC14 Development Shell as administrator to export BC14 object in new syntax.
Run the following command to export object in text file.
Syntax
Export-NAVApplicationObject [-DatabaseName] <String> [-Path] <String> [-DatabaseServer <String>] [-Filter <String>] [-ExportToNewSyntax]
To know more about this command Export-NAVApplicationObject
Command
Export-NAVApplicationObject -DatabaseName 'Demo Database BC (14-0)' -Path 'D:\Blog\CAL_AL\Report207.txt' -DatabaseServer 'SRIDHARLAKSHMAN\BCDEMO' -ExportToNewSyntax -Filter 'Type=Report;Id=207'
Converting the Objects to new syntax
The Txt2Al conversion tool (txt2al.exe) is only available with version 14, which is the last version to support C/AL.
You find the txt2al.exe in the "C:\Program Files (x86)\Microsoft Dynamics 365 Business Central\140\RoleTailored Client" folder.
- Open Command Prompt Run as Adminstrator.
- Run the following command
- cd C:\Program Files (x86)\Microsoft Dynamics 365 Business Central\140\RoleTailored Client
- Txt2Al.exe --source="D:\Blog\CAL" --target="D:\Blog\AL"
- SalesCreditMemo.Report.al (Which is AL file)
- SalesCreditMemo.Rdlc(which is Rdlc file), we need to convert this to Rdl file.
Here we have converted Sales Credit Memo report to AL, I have renumbered the id to save it in Custom series and can modify this report according to our requirement and publish it.
For more details regarding AL code: Stayed tuned with https://sridynamics.blogspot.com



Comments
Post a Comment