Modify Check in D365FO

In this blog, I will demonstrate you how to modify existing Check for Bank Accounts in Dynamics 365 Finance and Operations.

The upper part of Check is called 'Check Stub' . This portion contains invoice lines. This part of check contains the details about the amount paid. This entire portion exist in one field called ‘slipText’. Lower part of Check contains the Total amount, Name, company logo and Signature.

Check Layout
Fig 1.0 Check Layout

‘CheckDP’ class is responsible for data on Check Report. Check displays data in report from?ChequeTmp table. 'Check stub' has invoice lines with header details. Entire stuff in 'Check stub' exist in single string field called 'slipText’?of table 'ChequeTmp'.

Here is the hierarchy to for 'slipText' field.

ChequeDP > populateChequeTmp()?

No alt text provided for this image
Fig 2 ChequeDp class

Value in ‘tmpChequePrintout.slipTxt’ fills from CustVendCheque(Class) output() method

No alt text provided for this image
Fig 3 CustVendCheque class

If you further go into the fllSlipText method you will see 'determineSlipTextTitleAndEndLinesAdjustmentForColumnHeaders' method. This method concatenate strings and prepare header text of check stub. I will extend this method later in this blog.

No alt text provided for this image
Fig 4 CustVendChequeSlipTextCalculator class

In same class 'CustVendChequeSlipTextCalculator?', method ‘determineSlipTextAndEndLinesAdjustmentForBankChequePaymTrans’ is responsible for Lines or details in check stub. I will extend this method later in this blog.

No alt text provided for this image
Fig 5 CustVendChequeSlipTextCalculator class

Lets start changings in check

1-??Create Duplicate Report

No alt text provided for this image
Fig 6 Duplicate Report

2-?Create Extension of class ‘ChequeController′.?Extend ‘determineReportMenuOutput’ method and add name of your report and design.

No alt text provided for this image
Fig 7 FACheckController_Extension

3-??After step 2, when you run your check, it will open your report. In my case requirement is to modify check stub and add new field in check. To make changes on check stub follow the following steps:

i.????As discussed above the Output method on VendCheque is responsible for check and check stub. Create extension of class ‘CustVendChequeSlipTextCalculator’.

The hierarchy of classes is VendCheque > CustVendChequeSlipTextCalculator (method).?To modify header or columns of invoice lines you have to extend the method ‘determineSlipTextTitleAndEndLinesAdjustmentForColumnHeaders’.?

No alt text provided for this image
Fig 7 FACustVendChequeSlipTextCalculator_Extension

ii. ?To modify invoice lines in check stub extend the method ‘determineSlipTextAndEndLinesAdjustmentForBankChequePaymTrans’

No alt text provided for this image
Fig 8 FACustVendChequeSlipTextCalculator_Extension

Changes for Check stub has been completed. Now make changes to Check.

5-??To add new field on check. Create extension of table ‘TmpChequePrintout’ and add new field.

No alt text provided for this image
Fig 9 TmpChequePrintout table extension

6-?Create extension of class ‘CustVendCheque’ and extend method ‘output’. Set value in new field and update temp table.

No alt text provided for this image
Fig 10 FACustVendCheque_Extension

7-?ChequeTmp is main datasource on Check.?In ‘ChequeDP’ class values in ChequeTmp table fills from ‘TmpChequePrintout’ table.?Create extension of table ‘ChequeTmp′and add new field (Same as added in step 5)

No alt text provided for this image
Fig 11 ChequeTmp Extension

8-?Create extension of class ‘ChequeDP’ and extend method ‘populateChequeTmp’. Set value in newly added field of temp table ‘ChequeTmp’.

No alt text provided for this image

Modifications on Check has been completed. Build and Deploy Report.?

This is very informative. Good job Farman Ameer

要查看或添加评论,请登录

Farman Ameer的更多文章

社区洞察

其他会员也浏览了