Mismatch: Value Entry/Item Ledger Entry No. - Document No. NAV2015

jsinisajsinisa Posts: 20Member
Hi all,
here one strange case.
wzgsjsts9om3.png

as you can see timestamp follows Entry No.: bigger timestamp -> bigger Entry No. This is OK.
but, if you look at Document No. then it is strange. Earlier created Item Ledger Entry has "later" Document No. Documents BL**** are Posted Sales Shipments.
If I look at Value Entries for these Item Ledger Entries, I can see that Sales Invoice No's follow timestamp and Entry No., but Shipments not:
4mmyfsfyfcxi.png

How is that possible? What is possible scenario for that behavior?

Best Answer

Answers

  • jsinisajsinisa Posts: 20Member
    OK, I can get that.
    Then it is the same with Entry No.'s?
    I saw right now that some Adjustments were done where latest Invoice was adjusted first and so on.
    That explains everything

    Thank you Slawek
  • Slawek_GuzekSlawek_Guzek Posts: 1,444Member
    No, it is not. It would be if you only inserted new records into Value Entry and never updated any. Each update operation refreshes the timestamp value in the record.

    By ordering by timestamp you are effectively getting records in order of physical write operations performed on them (both writes count; the first write when a record is inserted and subsequent when it is modified)

    If you Inserted record A, inserted record B, modified record A then the Entry No order would be A, B, but the timestamp order would be B, A
    Slawek Guzek
    Poszukuje programistow znajacych Microsoft Dynamics NAV
  • KishormKishorm Posts: 897Member
    jsinisa wrote: »
    OK, I can get that.
    Then it is the same with Entry No.'s?

    No, Entry No.s are fixed and do not change if/when you modify the record.
  • jsinisajsinisa Posts: 20Member
    OK, I see.
    But, then is question again how is possible that sequence for Posted Sales Shipment (Documents BL...) is not following Entry No.'s? Not in ILE, not in Value Entry.

    According to NoSeries, BL18-04716 must have been created before BL18-04846 (Posting Date also shows that).
    Still, earlier Entry No. in ILE for Item HSU-004362 has Posting Date and Document No. later on.

    Then it must be the case, that Adjustment has updated Posting Date and Document No in ILE with Entry No. 560264?
    Here how it looks:
    de942b1cgaq2.png
  • KishormKishorm Posts: 897Member
    All postings are in order of Entry No.

    It is possible to post one document with a posting date and then post the next document with an earlier posting date so these won’t just be increasing along with Entry no.s

    Value Entries can be posted as part of cost adjustments so this is one reason why document no.s are not always in order there (they post with the original document no.)

    Sales/purchase documents get allocated a posted no. early in the posting routine but an error may occur in the posting in which case the posted no. is still allocated (eg 1000) but the document and ledger entries are not posted. The next document that gets posted will get the next no. (eg 1001j. I.e you get 999 posted then 1000 posted. In this scenario the document allocated 1000 still hasn’t been posted and maybe posted days later causing the document no.s to be posted out of sequence in the ledger tables. This affects all the Ledger tables, including item ledger entry and value entry.
  • BlackTigerBlackTiger Posts: 1,096Member
    Never use timestamps, entry no., GUID in business logic. SQL updates timestamp every record change, entry no. is just a sequential number used as primary key, GUID is pseudorandom value used ONLY to uniquely identify something across ... this planet (values are not necessary sequential).
    "You can’t just ask customers what they want and then try to give that to them.
    By the time you get it built, they’ll want something new.” Steve Jobs
Sign In or Register to comment.