After installing application Hotfix released on KB #2786631, it is not possible to cancel Invoice in Invoice approval journal on AX 2009 SP1 RU6 or higher

 Issue description:

After installing application Hotfix released on KB #2786631, it is not possible to cancel Invoice in Invoice approval journal on AX 2009 SP1 RU6 kernel/application build #5.0.1500.3761 or higher, it is no more possible to make an annulment of a posted invoice register in Approval journal.

You get an error message stating that Vendor account XXXX does not exist.

Workaround description:

The failure is caused by code pattern in \Classes\LedgerJournalCheckPost\postTrans in above mentioned application hotfix as shown below:

………….

    if (!ledgerJournalTransUpdate)

    {

         ledgerJournalTransUpdate = ledgerJournalTransUpdateAmountIncl;

    }

………..

Change code as described below, save and compile:

…………

    // Workaround to ensure we have the correct TransUpdate type

    if (!ledgerJournalTransUpdate)

    {

         if (ledgerJournalTable.JournalType == LedgerJournalType::Approval

         && _ledgerJournalTrans.AccountType == LedgerJournalACType::Ledger

         && _isOffset)

        {

                      ledgerJournalTransUpdate = LedgerJournalTransUpdate::construct(_ledgerJournalTrans);

        }

        else

        {

             ledgerJournalTransUpdate = ledgerJournalTransUpdateAmountIncl;

        }

    }

 …………

 

Disclaimer:

This programming example is for illustration purposes only. Microsoft disclaims all warranties and conditions with regard to use of the programming example for other purposes. Microsoft shall not, at any time, be liable for any special, direct, indirect or consequential damages, whether in an action of contract, negligence or other action arising out of or in connection with the use or performance of the programming example. Nothing herein should be construed as constituting any kind of warranty.

BlogPost.docx