Hi all,
I'm struggling to extend the project invoice. I'm familiar with the process having extended some of the other documents however this seems to be a bit of a pain. I created PrintMgtDocTypeHandlersExt
class PrintMgtDocTypeHandlersExt
{
[SubscribesTo(classstr(PrintMgmtDocType), delegatestr(PrintMgmtDocType, getDefaultReportFormatDelegate))]
public static void getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)
{
switch (_docType)
{
case PrintMgmtDocumentType::ProjectInvoice:
_result.result(ssrsReportStr(PSAProjInvoiceExt, Report));
break;
}
}
}
which references my new report design. I extended the menu items to point to my new controller PSAProjAndContractInvoiceControllerExt I took the standard main method and referenced my new class. I've tried many different things.
class PsaProjAndContractInvoiceControllerExt extends PSAProjAndContractInvoiceController
{
public static PsaProjAndContractInvoiceControllerExt construct()
{
return new PsaProjAndContractInvoiceControllerExt();
}
public static void main(Args _args)
{
PSAProjAndContractInvoiceControllerExt controller;
//
if (EInvoiceParameters_MX::isElectronicInvoiceEnabled()
&& EInvoiceProjController_MX::hasEInvoice(_args))
{
EInvoiceProjController_MX::main(_args);
return;
}
//
//
if (!ProjInvoiceJour_TH::canInvoiceBePrinted(_args))
{
return;
}
//
controller = new PSAProjAndContractInvoiceControllerExt();
controller.initArgs(_args);
controller.startOperation();
}
protected void outputReport()
{
SRSCatalogItemName reportDesign;
reportDesign = ssrsReportStr(PSAProjInvoiceExt,Report);
this.parmReportName(reportDesign);
this.parmReportContract().parmReportName(reportDesign);
formletterReport.parmReportRun().settingDetail().parmReportFormatName(reportDesign);
super();
}
}
If you could tell me best way to extend PSAProjAndContractInvoiceController to redirect to custom ssrs design it would be hugely appreciated. Can't follow the standard documentation either https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/analytics/custom-designs-business-docs as this calls methods that don't exist in the proj class. Also, for some reason it refuses to display my custom design in print management, even though i've deployed the report multiple times.