SBX - Search With Button

SBX - Forum Post Title

Best approach to duplicate a standard Report and its related Classes and Tmp tables.

Microsoft Dynamics AX Forum

Sabarish K asked a question on 13 Jul 2018 4:03 AM

Question Status

Suggested Answer

I have a SalesInvoice report that is customized in the report Parameter form, Report Layout and Classes with logic. Customizations includes on all related standard TMP tables,Classes,Report Layout etc.

Now I have a requirement to bring back the standard report(without customizations in Parameter form, Layout, Classes) and make an option to run both standard and custom report in two menu items.

Basically I am trying to have 2 versions of Sales Invoice report 1-Standard 2-Standard+custom.

I can try removing customizations and bring the report back to standard, but I will not have custom report anymore.

If I try importing the custom xpo back, my changes will come back on the same salesInvoice report.

But instead would like these changes to happen on complete new custom report.

Should I create an exact duplicate of standard SalesInvoiceReport and manually compare and add my custom changes to the duplicate report? My worry is SalesInvoice is a vast report, duplicating sounds a bit risky in case I miss any related objects.

I was thinking if it was only Layout I can create a new design, but Parameter form is also modified(contract class).

What is the best approach to achieve this.

Reply
Boris Diroo responded on 16 Jul 2018 11:13 AM
My Badges
Suggested Answer

Hello Sabarish,

Please see the blog in the link below. I believe this will help you achieve what you want.  

community.dynamics.com/.../dynamics-ax-2012-how-to-duplicate-the-existing-report-for-modification

Hope this helps!

Reply
István Orosz responded on 17 Jul 2018 1:58 AM
My Badges
Suggested Answer

Hi,

The contract, controller and DP classes can be duplicated inside AOT. You can use the same parent class SalesInvoiceDPBase for your modifications , no need to duplicate that one. SalesInvoiceTmp can remain the same, maybe you can add you customized fields if there is any (be aware that it is a regular table as the parent class is derived from SrsReportDataProviderPreProcess). The report layout can be duplicated inside Visual Studio, so no need to create a new one just a new layout. You can use multiple layouts in SSRS from the controller class like this:

formLetterController.parmReportName(PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderInvoice).getDefaultReportFormat());
Reply
Boris Diroo responded on 16 Jul 2018 11:13 AM
My Badges
Suggested Answer

Hello Sabarish,

Please see the blog in the link below. I believe this will help you achieve what you want.  

community.dynamics.com/.../dynamics-ax-2012-how-to-duplicate-the-existing-report-for-modification

Hope this helps!

Reply
István Orosz responded on 17 Jul 2018 1:58 AM
My Badges
Suggested Answer

Hi,

The contract, controller and DP classes can be duplicated inside AOT. You can use the same parent class SalesInvoiceDPBase for your modifications , no need to duplicate that one. SalesInvoiceTmp can remain the same, maybe you can add you customized fields if there is any (be aware that it is a regular table as the parent class is derived from SrsReportDataProviderPreProcess). The report layout can be duplicated inside Visual Studio, so no need to create a new one just a new layout. You can use multiple layouts in SSRS from the controller class like this:

formLetterController.parmReportName(PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderInvoice).getDefaultReportFormat());
Reply

SBX - Two Col Forum

SBX - Migrated JS