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;
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Is it ok "grouping" the entries with the IF NOT INSERT.. ?
Thanks again
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.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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