Codeunit: 226 in Dynamics-NAV 4.00

Dr_mjhDr_mjh Member Posts: 203
Hi there,

We have a case in Dynamics-NAV 4.00 in which we have an invoice with two payments the payment has been applied to the invoice. Those payments have appeared to be wrong so when we wanted to unapply the payments this message appears:

(Before you can apply this entry, you must first unapply all application entries in Cust. Ledger Entries no.: 56 that were posted after this entry)

We checked by the debugger and we found this code in the code unit no. 266:

"IF (ApplicationEntryNo <> 0) AND (ApplicationEntryNo <> DtldCustLedgEntry."Entry No.") THEN
ERROR(Text012,CustLedgEntry.TABLECAPTION,DtldCustLedgEntry."Cust. Ledger Entry No.");"

It appears that the system checks if there is any application entry no. exists and if it does the error message pops out. It does make sense that there is an application entry no. because the invoice has been applied to two individual independent payments. So what is the point of this code? Anyway if we deleted this code the payments can be smoothly unapplied without any problems. I suspect that this code is a bug. I don't know if anyone would agree with me.
Any help my friends will be greatly appreciated.


Thank you for your cooperation.
Best Regards

Comments

  • jversusjjversusj Member Posts: 489
    Dr mjh wrote:
    Hi there,

    We have a case in Dynamics-NAV 4.00 in which we have an invoice with two payments the payment has been applied to the invoice. Those payments have appeared to be wrong so when we wanted to unapply the payments this message appears:

    (Before you can apply this entry, you must first unapply all application entries in Cust. Ledger Entries no.: 56 that were posted after this entry)

    We checked by the debugger and we found this code in the code unit no. 266:

    "IF (ApplicationEntryNo <> 0) AND (ApplicationEntryNo <> DtldCustLedgEntry."Entry No.") THEN
    ERROR(Text012,CustLedgEntry.TABLECAPTION,DtldCustLedgEntry."Cust. Ledger Entry No.");"

    It appears that the system checks if there is any application entry no. exists and if it does the error message pops out. It does make sense that there is an application entry no. because the invoice has been applied to two individual independent payments. So what is the point of this code? Anyway if we deleted this code the payments can be smoothly unapplied without any problems. I suspect that this code is a bug. I don't know if anyone would agree with me.
    Any help my friends will be greatly appreciated.


    Thank you for your cooperation.
    Best Regards
    try selecting the invoice the payments were applied to from the CLE. Then "unapply entries." you should then see a screen asking which entries to unapply. i just did it and it worked for me.

    if i tried by selecting the payment and clicking unapply, i got the error you have. tells me that the order in which you do it is important. good luck!
    kind of fell into this...
  • Dr_mjhDr_mjh Member Posts: 203
    Thank you jversusj for your reply.

    I've just done what you suggested on me but I had the same error message.
    Besides it is not a business logic in what so ever way for the order which I do it is important -It was not written even in the manuals- and how about the code? Is it logic to check if I unapply the invoice or the payment? and for what purpose i.e.: what difference does it make?

    Thank you for your cooperation.
    Best Regards
  • ArhontisArhontis Member Posts: 667
    FYI: There is a bug on the apply/unapply that prevents Nav in posting a zero amount G/L Entry to get a new Transaction No. and so mark the detailed entries with that transaction no. so that you can unapply the correct entries, correctly.

    In order to see if you have that kind of error, check the transaction code of the detailed ledger entry you want to unapply if there is a corresponding (zero amount) G/L Entry with the same Transaction No.

    If there is no G/L Entry then you have the bug, and it will make you run in a loop by trying to unapply one and the other stops you and "vise versa"...

    In case you have that bug then you should make a post an mbs incident to get your local corrections...
Sign In or Register to comment.