Monday, September 14, 2020

Substitute a Standard Report with your Custom Report in Microsoft Dynamics 365 Business Central

 Hi Readers, 

I hope you are having a great day!

Today, we'll talk about another interesting topic of Business Central and that is, how you can use the same action and its properties that has a Standard Report and replace it with your own Custom Report and this can be done just by using simple Events. How cool is that! 

Let's get started!

As you might know, standard reports cannot be changed in Business Central. So if there are any changes required we have to create a new al file and a report layout.

To know more about it, visit my other blog: https://jyotsnanav.blogspot.com/2020/07/creating-new-report-and-modifying.html

To overcome this, we will use a Publisher OnAfterSubstituteReport from the Codunit Codeunit 44 – ReportManagement and subscribe to this Publisher. 

If you don't know how events work, refer: https://jyotsnanav.blogspot.com/2020/05/publishing-events-raising-events-and.html

Here, we'll take an example of Item Card. It has a report action 'Item/Vendor Catalog' and a has a Report Item/Vendor Catalog on its RunObject. But I want to have my Custom report on the action instead since there are layout and code changes. 

So I will create a Codeunit ReplaceStandardReport (Quick tip: You can use the same codeunit for this functionality so that your Workspace is segregated categorically and systematically) and a Subscriber of the mentioned publisher, as shown below:

And that's it! 

Now whenever you'll run your Action, it will be your Custom report. This saves a lot of time and energy since you need not extend page, create a new action or assign properties. 

Note: You can only use this if your Report is on RunObject (and its static methods) and not when it is declared as a Variable. For situations like these, you'll either have to use a publisher if it raised on the action and subscribe to it. Otherwise, you'll have to create a new action and that will have your custom Report and you can hide the standard action. 


I hope that this blog was helpful. Have a great day and Stay tuned for another one!

Check out other blogs, if you haven't already. 

Please suggest what else do you want me to blog about. Keep following and supporting!

You can also email me at jyotsnaoberainav@gmail.com

Also, visit my website JONAV if you need help with any NAV/BC Services!

Thank you! 

6 comments:

  1. I'm Абрам Александр a businessman who was able to revive his dying lumbering business through the help of a God sent lender known as Benjamin Lee the Loan Consultant. Am resident at Yekaterinburg Екатеринбург. Well are you trying to start a business, settle your debt, expand your existing one, need money to purchase supplies. Have you been having problem trying to secure a Good Credit Facility, I want you to know that Mr Benjamin will see you through. Is the right place for you to resolve all your financial problem because am a living testimony and i can't just keep this to myself when others are looking for a way to be financially lifted.. I want you all to contact this God sent lender using the details as stated in other to be a partaker of this great opportunity Email: 247officedept@gmail.com  Or  WhatsApp/Text +1-989-394-3740.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. SMB ERP Solution is a Microsoft Silver Partner. We provide Supply Chain Management Solutions, Microsoft NAV, Microsoft Dynamics NAV, Microsoft Dynamics Business Central. Contact us info@smb-erpsolutions.com for more details. Check out our website for more detials- Dynamics NAV Upgrade

    ReplyDelete