Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 143529

Unable to cast object of type 'Dynamics.Ax.Application.LedgerJournalEngine' to type 'Dynamics.Ax.Application.LedgerJournalEngine_VendInvoice'.

$
0
0

I came across an issue recently where my Timesheets wouldn't post in 'Batch'.

It turns out that it wouldn't perform the following code in 'Batch', but would be fine doing it in the Client.

LedgerJournalEngine_VendInvoice         ledgerJournalEngine;

ledgerJournalEngine = LedgerJournalEngine::construct(LedgerJournalType::VendInvoiceRegister);

If we go to the 'construct' method, we will see it returns the 'default' in the switch case:

default :

            ledgerJournalEngine = new LedgerJournalEngine(_formRun);

When running this in the client, it works fine.  When running it in 'Batch' on the server, it fails:

Unable to cast object of type 'Dynamics.Ax.Application.LedgerJournalEngine' to type 'Dynamics.Ax.Application.LedgerJournalEngine_VendInvoice'.

This does make sense that you can't cast a 'Child' class to it's 'Parent', however, why would this work on the Client but not in Batch?


Viewing all articles
Browse latest Browse all 143529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>