MADHDA Business Solutions
  • Home
  • About Us
    • Privacy Policy
  • Services
    • Implementations
    • Support
    • Training
    • Upgrade
    • Business Analysis
  • Solutions
    • MS Dynamics 365 Business Central
    • MS Dynamics Nav
    • MS Dynamics 365 Sales/CRM
    • Power BI
    • Power Automation
  • Resources
    • Blog
  • Contact Us
  • Substituting a Report in Business Central

Substituting a Report in Business Central

7 November 2020

Substituting a Report in Business Central

Hello Philomaths,

Today,I came with widely used feature of business central.Contrary to pages and tables, extensibility is not yet supported for report objects in Business Central. Therefore, if you want to make any changes to the dataset or the layout of a base application report, you must create a new version of the report and apply the changes on the new object. Then you can override the base report with your own customized version by subscribing to the OnAfterSubstituteReport event published by Codeunit 44 – ReportManagement.

 the concept is to replace a report for another report through out the Business Central  / Dynamics NAV.

In following example , we replace standard “Assembly order ” report with our custom “Assembly Order New” report . Here we just need to subscribe an event and apply Report ID as parameter.

codeunit 50102 “Substitute Report”

{

    [EventSubscriber(ObjectType::Codeunit, Codeunit::ReportManagement, ‘OnAfterSubstituteReport’, ”, false, false)]

    local procedure OnSubstituteReport(ReportId: Integer; var NewReportId: Integer)

    begin

        if ReportId = Report::”Assembly Order” then

            NewReportId := Report::”Assembly Order New”;

    end;

}

When the “OnAfterSubstituteReport” event is raised, the event subscriber method is called and the replacement takes place.

So, When you run “Assembly Order” report through below action , this OnAfterSubstituteReport event raised and New custom report runs. This is what you want to do.

The OnAfterSubstituteReport event is raised when The user activates a page action that runs the report to be substituted, that is, an action that has the RunObject Property set to the report.

That’s all. Thanks for reading , I hope I explain well enough to understand the concept even though need any help contact me at my email Sagar@madhda.com

 

Previous post: Difference between “Preview” and “Preview & Close” button when running Reports in Business Central 17
Next post: SetLoadFields in Business Central

Categories

  • Microsoft Dynamics 365
  • Microsoft Dynamics Business central
  • Microsoft Dynamics NAV
  • Uncategorized

Recent Post

  • Business Central : Retrieving Azure AD User information via AL.
    March 20, 2023
  • Change Authentication method from Basic Auth to OAuth2 while accessing Business Central Webservice / APIs.
    February 27, 2023
  • How to use "Dictionary" Object type into Business Central.
    February 17, 2023
  • Post Transaction Using Configuration Package in Business Central.
    February 13, 2023
  • How to Import Image from Excel to BC using Azure function.
    February 6, 2023
 


    © Copyright 2020 | All Rights Reserved By MADHDA