Friday, 25 January 2019

Customize design and business logic of standard SSRS report in D365 F&O

Today, I will be discussing about how to customize or perform changes without over layering in the standard SSRS report of D365 F&O.

Let's take an the example of SalesInvoice Report in AX.  For example our client has a requirement of performing few changes within Sales invoice report just like he want additional field so we can follow below mentioned steps in order to achieve this target.

Step 1) Create a new project.

Step 2) Assume that I want to add AdditionalQty field on body of report so I am going to create a extension of SalesInvoiceTmp table and add required fields within it.






Step 3) Build and Synchronize the table.

Step 4) Create a new helper class in my case I have created SalesInvoiceHelper class and copy onInserting event handler of SalesInvoice tmp table. Add logic within the copied event handler.












Note : For the demo purpose I have added logic for this  field. Whereas as  you can add logic as per your requirements.












Step 4) Duplicate the report  and give it a new name. Make changes in design accordingly.


















Step 5)  Go to PrintMgmtDocType class and copy event handler of getDefaultReportFormatDelegate and subscribe to its event handler. Add logic in the method to call this new report in helper class.























Step 6) Duplicate Sales invoice controller class  by creating new controller and change its logic in order to call your new report.

For instance in my class I have replaced SalesInvoicecontroller instance with salesInvoiceControllerDemo and called my report SalesinvoiceDemo with design Report.

















Step 7)  Extend sales invoice report menu item and change its controller property to your new controller.


Before creating new extension of menu item.










After creating new extension.











Build the complete project and execute your report.

Here comes the error.









Oops. Probably I missed something and that is deploying my report. Right click on your project and select deploy reports.

One more thing go to Account receivable ->Setup -> Form setup -> Select print management
Go to customer invoice node and select your design and report there too.












Final output with our custom column.

1 comment:

  1. Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post! Eenhoorn

    ReplyDelete

Note: only a member of this blog may post a comment.

Custom Business events Part 3 - (Activate custom business event) in D365 F&O

 In this blog we will discuss about the steps to activate a custom business in D365 F&O. As we know that business event catalog does not...