Tag: Substitute Report

How to Substitute Report in Business Central

Today we will see how we can substitute our own document report with Standard report in business central.

To override report we need to use ReportManaagement Codeunit and from that we need to use OnAfterSubstituteReport event

Suppose we have created own customize report called ‘Detail Inventory Transaction’ and now we have to replace standard report for Inventory Transaction Detail

[EventSubscriber(ObjectType::Codeunit, 44, 'OnAfterSubstituteReport', '', true, true)]
    procedure SubstituteInventoryTransactionReport(ReportId: Integer; var NewReportId: Integer)
    begin
        If ReportId = Report::"Inventory - Transaction Detail" then
            NewReportId := Report::"Detail Inventory Transaction";
    end;

Publish your extension and check the report .You will find new report is substituted with standard report.

Hope this will help you.

Stay tuned for more..