Hi,
Assuming you need both custom and original report do below. If you want to delete custom and get only original then as suggested by Nikolaos, delete all objects.
Your Custom controller class should like below:
class CustomSalesInvoiceController extends SalesInvoiceController
{
public static CustomSalesInvoiceController construct()
{
PgonSalesInvoiceController controller = new CustomSalesInvoiceController();
return controller;
}
public static void main(Args _args)
{
SalesInvoiceController formLetterController = CustomSalesInvoiceController::construct();
formLetterController.parmArgs(_args);
formLetterController.parmReportName(ssrsReportStr(CustomSalesInvoice, Report));
formLetterController.parmShowDialog(false);
formLetterController.parmDialogCaption("@SYS22766");
formLetterController.startOperation();
}
}
You have created 2 objects, assigned value to 1, and used other to start the report execution.
There is code missing to add the custom report to Print management. To do that check thread https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/209395/print-management-adding-new-design?pifragment-96834=1
In the screenshot, you added where you are setting a custom report name to be used in print management will give an error.
When you are using original/copy option to print it will take a custom report because that is what you set in getDefaultReportFormatDelegate method.
When you use print management then whatever is set in print management will be used.