Report: BankPaymAdviceVend
Class: BankPaymAdviceVendController, BankPaymAdviceVendPrint,
PrintMgtDocTypeHandlerExt
Output MenuItem: BankPaymAdviceVend
2.
Create model
Go to Dynamics 365àModel Management àCreate model
3. Click Next
4. Click Next, Select ApplicationFoundation and ApplicationSuite
5. Create Next and Create new project
6.
From AOT, find Report BankPaymAdviceVend
If you want how to find it is this report. You can find the Payment
advice button from payment journal and it’s menu item BankPaymAdviceVendPrint, then you can find it calls class BankPaymAdviceVendPrint, and this class call menu item BankPaymAdviceVend
7. Then menu item calls controller BankPaymAdviceVendController,
this controller call report BankPaymAdviceVend.
8. Duplicate the report and rename to BankPaymAdviceVendExt
9. Then Open BankPaymAdviceVendExt
and apply the customizations you want.
10. For example:
11.
Deploy report
Right click the project and Rebuild, if no any errors, then Right
click the project and Deploy reports
12.
Create a new class that extends
the standard controller-- BankPaymAdviceVendController.
Right click ProjectàAddàNew Item…àClass, name BankPaymAdviceVendControllerExt
13. Override main method to specify the controller and report (Copy from
BankPaymAdviceVendController and change).
class BankPaymAdviceVendControllerExt extends BankPaymAdviceVendController
{
public static void main(Args _args)
{
SrsReportRunController controller = new BankPaymAdviceVendControllerExt();
controller.parmReportName(ssrsReportStr(BankPaymAdviceVendExt, Report));
controller.parmArgs(_args);
controller.parmShowDialog(false);
controller.startOperation();
}
}
14.
Add customized report into
default payment advice report list in print management.
Add a new class to the project. Name as PrintMgtDocTypeHandlerExt
to distinguish it from other object handlers.
Add a delegate handler method to start to use custom report. In this
example, extend the getDefaultReportFormatDelegate method in the
PrintMgtDocTypeHandlerExt class by using the following code.
class PrintMgtDocTypeHandlerExt
{
[SubscribesTo(classstr(PrintMgmtDocType), delegatestr(PrintMgmtDocType, getDefaultReportFormatDelegate))]
public static void getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)
{
switch (_docType)
{
case PrintMgmtDocumentType::VendPaymAdvice:
_result.result(ssrsReportStr(BankPaymAdviceVendExt, Report));
break;
}
}
}
15.
Create a extension of output
menu item BankPaymAdviceVend
17.
Change print management
settings
Go to Accounts payableàFormsàForm setup, on General tab, click Print management
Find payment advice and right clickàNew, select the report you created.
18.
Find a vendor payment journal
and try