Hello Everyone
Today i tried to replace the standard purchase order report with my custom report by changing the PurchPurchaseOrderController as below:
public static void main(Args _args)
{
SrsReportRunController formLetterController = PurchPurchaseOrderController::construct();
PurchPurchaseOrderController controller;
if (TradeFormHelper::isCalledFromForm(_args, formStr(VendPurchOrderJournalListPage)))
{
_args.record(VendPurchOrderJour::findRecId(_args.record().RecId));
}
controller = formLetterController;
controller.initArgs(_args, ssrsReportStr(CustomPurchaseOrder, Report));
if (classIdGet(_args.caller()) == classNum(PurchPurchOrderJournalPrint))
{
formLetterController.renderingCompleted += eventhandler(purchPurchOrderJournalPrint::renderingCompleted);
}
formLetterController.startOperation();
}
In the "controller.initArgs" method i have already use my report "CustomPurchaseOrder", but when i try to run the report from "Purchase Order->Purchase->Purchase Order Confirmations->Preview/Print->Original Preview" i still got the old report.
Note:
The system keep using the static report, but if i comment the code "controller.initArgs(_args, ssrsReportStr(CustomPurchaseOrder, Report));", it will encounter an error. there must be somewhere the system replace my code with the standard report.