Date Compress Item Ledger Entry

StyvieStyvie Member Posts: 77
We are having some problems with Navision's date compress Item Ledger Entry.

We want to retain the Source No and Source Posting group fields. If we tick those 2 fields, we do not get any compression... I have checked the code and have found the following issue... in the CompressValueEntries function... the following lines exist...


IF ValueEntry."Gen. Bus. Posting Group" <> "Gen. Bus. Posting Group" THEN
EXIT(FALSE);
IF ValueEntry."Gen. Prod. Posting Group" <> "Gen. Prod. Posting Group" THEN
EXIT(FALSE);
IF ValueEntry."Inventory Posting Group" <> "Inventory Posting Group" THEN
EXIT(FALSE);
IF RetainNo(FIELDNO("Document No.")) AND (ValueEntry."Document No." <> "Document No.") THEN
EXIT(FALSE);
IF RetainNo(FIELDNO("Source Type")) AND (ValueEntry."Source Type" <> "Source Type") THEN
EXIT(FALSE);
IF RetainNo(FIELDNO("Source No.")) AND (ValueEntry."Source No." = "Source No.") THEN
EXIT(FALSE);
IF RetainNo(FIELDNO("Source Posting Group")) AND (ValueEntry."Source Posting Group" = "Source Posting Group") THEN
EXIT(FALSE);
IF RetainNo(FIELDNO("Salespers./Purch. Code")) AND (ValueEntry."Salespers./Purch. Code" = "Salespers./Purch. Code") THEN
EXIT(FALSE);

From "Source No." on, they do an "=" check as opposed to the "<>" check on the other fields.

Has anybody else found this ? Is it an error ? I have check version 4.0 and same code exists.

I have changed the = to a <> and all "Seems" to be fine, although I am scared now to run this for 6 million Item Ledger entries..

Any one with a suggestion ? I have logged with MS but they have not come back to me yet ?

Thanks

Comments

  • EugeneEugene Member Posts: 309
    you fixed it right
    in the new version the = is replaced with <>
  • ara3nara3n Member Posts: 9,256
    I strongly suggest not to use Item Ledger Date compression. It has been removed from 5.0 for a good reason.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • EugeneEugene Member Posts: 309
    indeed, even in the "Changes Made in Microsoft DynamicsTM NAV W1 4.0 SP2" there is an issue with it

    A234) Not All Item Ledger Entries Compressed
    Error
    When running batch job “Report 798 Date Compress Item Ledger” not all item ledger entries were compressed.

    This has been corrected
    Report 798 Date Compress Item Ledger

    Even though i have 4.0 SP3 i still have issues with that report (orphant "Item Ledger Entries" that is with missing "Value Entry" after compression)
  • David_SingletonDavid_Singleton Member Posts: 5,479
    ara3n wrote:
    I strongly suggest not to use Item Ledger Date compression. It has been removed from 5.0 for a good reason.

    :thumbsup:


    Please take Rashed's advice. You can cause serious damage to your database running this routine.
    David Singleton
  • EugeneEugene Member Posts: 309
    i found the bug that was causing trouble in ver NAV4 SP3

    in the trigger
    Item Ledger Entry - OnAfterGetRecord()

    the code
    DimBufMgt.CollectDimEntryNo(
        TempSelectedDim,DATABASE::"Item Ledger Entry","Entry No.",
        0,FALSE,DimEntryNo);
      OldDimEntryNo := DimEntryNo;
    
    should be:
    DimBufMgt.CollectDimEntryNo(
        TempSelectedDim,DATABASE::"Item Ledger Entry","Entry No.",
        0,FALSE,DimEntryNo);
      ComprDimEntryNo := DimEntryNo;
    
  • Alex_ChowAlex_Chow Member Posts: 5,063
    There are most likely more issues with that with date compressing item ledger... :(
  • EugeneEugene Member Posts: 309
    well, strike my last post about ComprDimEntryNo := DimEntryNo; the original code there (OldDimEntryNo := DimEntryNo;) seems to be ok.

    The real issue is that after compression Item Ledger Entries are kept separate for negative and positive Quantities (compression sums up positive and negative separately and inserts Item Ledger Entry for each) but their corresponding Value Entries get summed up and assigned to the first Item Ledger Entry (be it summary of positive quantities or of negative quantities). I believe this bug was present since introduction of Value Entry table (was it since version NAV 3.0 ?)
  • EugeneEugene Member Posts: 309
    having solved the missing Value Entries problem there is another one - The report in question crashes with error if the 2 item ledger entries have the same values of all retain fields and of two global dimensions but have different values of one of the non global dimensions
Sign In or Register to comment.