
Hi Expert
I am facing an issue after updating the D365 FO from old to (10.0.31), I have customized controller class through which we are printing our custom report design, but after update the system throw exception like, before update there was a class BankPaymAdviceVendController which later on updated to BankPaymAdviceVendControllerV2 in(10.0.31)
following are our customized class :
| An error occurred when running report BankPaymAdviceVendV2.Report. Message: Unable to cast object of type 'Dynamics.AX.Application.BankPaymAdviceReportGeneratorVendExt' to type 'Dynamics.AX.Application.BankPaymAdviceReportGenerator'.. |
| exceptionType | System.InvalidCastException |
| stackTrace | System.InvalidCastException: Unable to cast object of type 'Dynamics.AX.Application.BankPaymAdviceReportGeneratorVendExt' to type 'Dynamics.AX.Application.BankPaymAdviceReportGenerator'. at Dynamics.AX.Application.BankPaymAdviceReportGenerator.`newForJournal(String _ledgerJournalId) at Dynamics.AX.Application.BankPaymAdviceReportGenerator.newForJournal(String _ledgerJournalId) at Dynamics.AX.Application.BankPaymAdviceVendControllerV2.printLine(LedgerJournalTrans _ledgerJournalTrans, BankPaymAdviceContract _contract, SrsPrintDestinationSettings _printSettings, NoYes _shouldDefaultFromPrintMgmt) at Dynamics.AX.Application.BankPaymAdviceVendControllerV2.printContractQuery() at Dynamics.AX.Application.BankPaymAdviceVendControllerV2.`runPrintMgmt() at Dynamics.AX.Application.BankPaymAdviceVendControllerV2.runPrintMgmt() at Dynamics.AX.Application.SrsPrintMgmtController.run() |
Appreciate your expert suggestions.
Hi Munsif,
I think this is due to the customization you have done.
Code is trying to get object of type BankPaymAdviceReportGenerator but you are assigning some other values.
You need to debug the code and find out that piece of code which is causing this error.
Thanks,
Girish S.