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
0
Comments
in the new version the = is replaced with <>
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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)
:thumbsup:
Please take Rashed's advice. You can cause serious damage to your database running this routine.
in the trigger
Item Ledger Entry - OnAfterGetRecord()
the code
should be:
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
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 ?)