Tuesday, February 19, 2019

NAV Extensions - Extend Page, Convert CAL text report to AL Extension Report


  • Export report from NAV Development environment as text file (C:\CAL\1COA.txt)
  • Launch Development shell as Admin
    • cd "C:\Program Files (x86)\Microsoft Dynamics 365 Business Central\130\RoleTailored Client"
  • Run the following to convert the CAL text to AL code
    • ./txt2al --source="C:\CAL" --target="C:\AL" --rename
  • This will generate converted files in the C:\AL folder
  • Copy these files into your Visual Studio Code Project folder
    • Modify the *.al file to point to the rdlc
    • Remove the # characters
    • Change dataitem line to reflect actual table names
      • Change dataitem(DataItem1; Table18)
      • to dataitem(Customer; Customer)
    • Create page action button to launch the report
pageextension 50100 MyExtension extends "Chart of Accounts"
{
layout
{
}
actions
{
// Add changes to page actions here
addafter("Detail Trial Balance")
{
action("Custom Report")
{
Promoted = true;
PromotedCategory = Process;
ApplicationArea = All;
trigger OnAction();
begin
clear(myReport);
myReport.Run;
end;
}
}
}
var
MyReport: Report CusList;
}

No comments:

Post a Comment