Numeric value out of range State ID: 22003

engnguzelengnguzel Member Posts: 4
The Adjust Cost - Item Entries batch repeats infinitely when the same item - location code - variant code combination is output and consumed in the same date. As a solution to that bug I installed the hotfixes numbered 925862-978605-978603-978606-978702. But after installing the hotfixes we got "Numeric value out of range State ID: 22003" error in the SQL-option and "decimal overflow" in the native option. Unfortunately it's impossible to figure out the problem by debugging. Thank you in advance for your help.
The current version of NAV is 4.03 SQL Option.
Version = Navision 403 SQL
Costing Method = Average

Comments

  • JedrzejTJedrzejT Member Posts: 267
    HI,

    I have this problem once - i think I post subject about it.
    It not that easy to identify the wrong value

    Example:
     OkDec:=111111111111111.00; - this is the largest decimal we can insert in code (number of signs)
    BadDec:=OkDec*10000; - Nav calc it
    TD.GET(1);
    TD.DecTmp:=BadDec; - still ok
    TD.MODIFY; - Nav ca't modify the record (decimal overflow)
    

    In your case - When you debug - Nav stops in line Insert or Modify ?
    Then check what decimal values - script try to insert in this record. (one of them is too large)
    When you know where the problem is (which entry) maybe you find out - what cause this bad calculate (probably bad) and solve this.
  • engnguzelengnguzel Member Posts: 4
    Nav stops in line Insert
  • rdebathrdebath Member Posts: 383
    I said ...
    viewtopic.php?f=23&t=40917#p202778

    Though in your case you should already have one of the item ledger entry numbers in the loop.
  • engnguzelengnguzel Member Posts: 4
    ////I said ...
    ////viewtopic.php?f=23&t=40917#p202778

    ///Though in your case you should already have one of the item ledger entry numbers in the loop.

    I tried instructions above unfortunately it did not work
  • superpuzsuperpuz Member Posts: 53
    Has anyone know the solution for this error? I've added a function bellow:
    +    LOCAL PROCEDURE MaxConsumptionValuationDate@86(ProdOrderNo@1000 : Code[20]) : Date;
    +    VAR
    +      ValueEntry@10001 : Record 5802;
    +      ValuationDate@1002 : Date;
    +    BEGIN
    +      ValueEntry.SETCURRENTKEY("Prod. Order No.");
    +      ValueEntry.SETRANGE("Prod. Order No.",ProdOrderNo);
    +      ValueEntry.SETRANGE("Item Ledger Entry Type",ValueEntry."Item Ledger Entry Type"::Consumption);
    +      IF ValueEntry.FIND('-') THEN
    +        REPEAT
    +          IF (ValueEntry."Valuation Date" > ValuationDate) AND
    +             (ValueEntry."Entry Type" <> ValueEntry."Entry Type"::Revaluation)
    +          THEN
    +            ValuationDate := ValueEntry."Valuation Date";
    +        UNTIL ValueEntry.NEXT = 0;
    +      EXIT(ValuationDate);
    +    END;
    

    The code itself came from a Change Log I received form MBS Support Team (APAC). The error occur in the code IF ValueEntry.FIND('-') THEN. The error occur after the same code has been executed several times with no error, eventually in certain ProdOrderNo ("Item Ledger Entry"."Production Order No."), the error occur.

    The NAV is NAV 2009 R2, SQL Server is SQL Server 2008 RTM (No SP installed)
    Regards and Thanks,


    Superpuz
Sign In or Register to comment.