Update 3.70 -> 4.00 SP2 Error

amangamang Member Posts: 14
Hi,

i´m using the Updgrade Toolkit from 4.00 SP2. When i start step 2 (Transfer data from temp-tables to original tables), i get an error that the Application Entry already exists.

This is the Code from Codeunit 104048:
WITH ItemApplEntry DO
  IF StateIndicator.UpdateTable(TABLENAME) THEN BEGIN
    TimeLog.TimeLogInsert(TimeLog,TABLENAME,TRUE);
    IF FIND('-') THEN BEGIN
      REPEAT
        IF "Item Ledger Entry No." = "Inbound Item Entry No." THEN BEGIN
          ItemLedgEntry.GET("Item Ledger Entry No.");
          TempItemApplEntry := ItemApplEntry;
          TempItemApplEntry."Entry No." := "Inbound Item Entry No.";
          TempItemApplEntry."Cost Application" := ItemLedgEntry.Open;
          TempItemApplEntry.INSERT;
        END;
      UNTIL NEXT = 0;

In our Database are several Item Application Entries with the same "Inbound Item Entry No.".
Has somebody the same problem while updating?

kind regards

Comments

  • ara3nara3n Member Posts: 9,256
    You could change the code to if TempItemApplEntry.INSERT then; but I would suggest contacting MS for the error and see if they have a fix.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • AlishaAlisha Member Posts: 217
    Hi,

    I have this same problem upgrading from 3.70 to 5.00, anyone can help?
    Is the original data wrong because several entries have the same "Inbound item entry no."?

    Thanks
  • ara3nara3n Member Posts: 9,256
    Alisha wrote:
    Hi,

    I have this same problem upgrading from 3.70 to 5.00, anyone can help?
    Is the original data wrong because several entries have the same "Inbound item entry no."?

    Thanks

    the data is fine. it simply means that one inbound entry has been applied to many outbound entries. The code is the problem.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • AlishaAlisha Member Posts: 217
    You mean the code for the upgrade is wrong? How's that Microsoft has not fixed it for version 5.00?

    Is it ok "grouping" the entries with the IF NOT INSERT.. ?

    Thanks again
  • ara3nara3n Member Posts: 9,256
    Looking at the code again. I see now the issue.
    There should be only one entry in item application for the inbound entry where ("Item Ledger Entry No." = "Inbound Item Entry No." )

    Check your item application entry and see if this is the case, and that you have more than 1 entry.

    So adding the if insert then; would be fine.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • AlishaAlisha Member Posts: 217
    Thanks, I'm not sure if the data in the DB is correct, there are about 20 Item Application Entries with the same Item Ledger Entry No, Inbound Item Entry No, and Outbound Item Entry no = 0.

    There are even some entries with a Item ledger entry number that does not exist on the Item ledger entry table! (and not because it's been deleted), it's number 140 when the last item ledger entry is 139..

    Anyway, I have lots of doubts about this data.. but at least I could finish the upgrade modifying the code.

    Thanks a lot for your help
Sign In or Register to comment.