Friday, October 30, 2020

Substituting a Reports in Business Central / Dynamics NAV

Hello Readers, 

Hope you're doing well.

 

In this article we will see Substituting a Reports, this feature is widely used in the Business Central where report extension is not available, the concept is to replace a report for another report through out the Business Central  / Dynamics NAV.


For the customized standard reports , we have to create a copy of the standard report and develop a custom report with the changes, to override a base report with your own report is quite difficult and time taking process, using Report Substitute codeunit (ReportManagement) we can easily achieve the same. 

 

How to substitute a report for another report.

To substitute a report, you create a method and subscribe it to the OnAfterSubstituteReport event, as shown in the code below. The OnSubstituteReport method replaces the report specified by the ReportId with the one given by the NewReportId parameter. In this example the "Details Trial Balance" report will be substituted for "Detail Trial BalanceUPG" report.



Thank you,

Anish Agrawal

NAV/Business Central Developer

Connect me on : +91-9770757595

Linkedin :Anish Agrawal



Thursday, October 29, 2020

Region Directive in AL (Business Central 2020 Wave 2)

Hello Readers, 

  

Hope you all are doing good with the new Business Central 2020 Wave 2 Release (BC17).

I was going through the new features released in the Business Central 2020 Wave 2 (BC17), i found the feature which is very useful for the developers i.e. Region Directive.

The #region is used to mark a block of code that you can expand or collapse. This can, for example, be useful for larger files for better readability or for focusing on code that you are currently working on. The #endregion specifies the end of a #region block of code.

A #region block must be terminated with a #endregion directive.

lets have a look how it works:

So in the below example i created a codeunit and set of functions and added 2 regions (as shown below).

1. #region Hello World

2. #region Ping Pong


Now when you collapse the region all the codes function written under the region will get collapsed (as shown below)

 

System collapsed all the functions written inside the #region Hello World.

 

 

Thank you,

Anish Agrawal

NAV/Business Central Developer

Connect me on : +91-9770757595

Linkedin :Anish Agrawal



Busines Central Developer

Mastering Financial Harmony: Bank Reconciliation with Copilot in Business Central

   Hello Readers, welcome to my blog! Fasten your virtual seatbelts and prepare to delve into the realm where code meets creativity. The fut...

Report Substituting