Adjust Cost...Item Entries batch job

BokkBokk Member Posts: 138
We have done an upgrade to 4.0 recently and are unable to get the Adjust Cost...Item Entries batch job to complete. It errors out on a specific item with the following message: "Select a Dimension Value Code for the Dimension Code REGION for the item ADF-002."

When I look at the item is has default dimensions selected, but they don't seem to be picked up. After running the job, I went in and re-selected the dimensions hoping that would impact it and ran the job again. No change.

I ran it in debug and it is stopping in CU 21 RunCheck() at the ELSE of the last IF condition (IF "Line No." <> 0 THEN ...)

Any information would be appreciated.

Thanks!
SGM

Comments

  • themavethemave Member Posts: 1,058
    It could be this, if the item dimension has code mandatory, but the original entry that it is trying to adjust did not have a code it causes this problem, you should be able to change the code mandatory field to optional.
  • koaladokoalado Member Posts: 70
    Hi, all:
    So, finally, how did you solve the problem? You mean for all the history entry without that dimension, I have to add it on manually? ](*,)
    Why the logic of Navision is such ... Is it possible that when I select a dimension for an account or an Item..., aslo add the dimension to all history entries?
    I want to do some test and come back.
    Please let me know if you have better solutions.
  • jonsan21jonsan21 Member Posts: 118
    Hi,

    I was just searching thru the historical post and want to resurface this topic. I had the same problem, anyone got a permanent solution for it? I did disable the code mandatory for that item (not only 1 item) and run the adjust cost batch manually (but for long run?)

    Rgds,

    Jon.
    Rgds,

    Jon.
  • DnealDneal Member Posts: 103
    I was also wondering if anyone had a solution for this issue. I found an article (Article id: 900748) on Microsoft Partner Source stating this issue is a known problem. However when I contacted Microsoft they told me it was not a bug but how the system works.

    Does anyway have a fix for this issue?

    Thanks,

    Dneal
  • ara3nara3n Member Posts: 9,257
    Hello here is a fix.
    OBJECT Report 59003 Temp Fix Item Ledger Dim 2
    {
      OBJECT-PROPERTIES
      {
        Date=07/06/06;
        Time=[ 5:57:46 PM];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        Permissions=TableData 32=rim,
                    TableData 355=rim,
                    TableData 5802=rim;
      }
      DATAITEMS
      {
        { PROPERTIES
          {
            DataItemTable=Table32;
            OnAfterGetRecord=BEGIN
                               DefDim.SETRANGE("Table ID",DATABASE::Item);
                               DefDim.SETRANGE("No.","Item No.");
                               IF DefDim.FIND('-') THEN REPEAT
                                   LedgerDim.SETRANGE("Table ID",DATABASE::"Item Ledger Entry");
                                   LedgerDim.SETRANGE("Entry No.","Entry No.");
                                   LedgerDim.SETRANGE("Dimension Code",DefDim."Dimension Code");
                                   IF LedgerDim.FIND('-') THEN BEGIN
                                      LedgerDim."Dimension Value Code" := DefDim."Dimension Value Code";
                                      LedgerDim.MODIFY;
                                   END ELSE BEGIN
                                      LedgerDim."Table ID" := DATABASE::"Item Ledger Entry";
                                      LedgerDim."Entry No." := "Entry No.";
                                      LedgerDim."Dimension Code" := DefDim."Dimension Code";
                                      LedgerDim."Dimension Value Code" := DefDim."Dimension Value Code";
                                      LedgerDim.INSERT;
                                   END;
                                   IF GLSetup."Global Dimension 1 Code" = DefDim."Dimension Code" THEN BEGIN
                                     "Global Dimension 1 Code" :=  DefDim."Dimension Value Code";
                                     MODIFY
                                   END;
                                   IF GLSetup."Global Dimension 2 Code" = DefDim."Dimension Code" THEN BEGIN
                                     "Global Dimension 2 Code" :=  DefDim."Dimension Value Code";
                                     MODIFY
                                   END;
    
                               UNTIL DefDim.NEXT = 0;
                             END;
    
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=12000;
                SectionHeight=211;
              }
              CONTROLS
              {
              }
               }
          }
           }
        { PROPERTIES
          {
            DataItemTable=Table5802;
            OnAfterGetRecord=BEGIN
                               DefDim.SETRANGE("Table ID",DATABASE::Item);
                               DefDim.SETRANGE("No.","Item No.");
                               IF DefDim.FIND('-') THEN REPEAT
                                   LedgerDim.SETRANGE("Table ID",DATABASE::"Value Entry");
                                   LedgerDim.SETRANGE("Entry No.","Entry No.");
                                   LedgerDim.SETRANGE("Dimension Code",DefDim."Dimension Code");
                                   IF LedgerDim.FIND('-') THEN BEGIN
                                      LedgerDim."Dimension Value Code" := DefDim."Dimension Value Code";
                                      LedgerDim.MODIFY;
                                   END ELSE BEGIN
                                      LedgerDim."Table ID" := DATABASE::"Value Entry";
                                      LedgerDim."Entry No." := "Entry No.";
                                      LedgerDim."Dimension Code" := DefDim."Dimension Code";
                                      LedgerDim."Dimension Value Code" := DefDim."Dimension Value Code";
                                      LedgerDim.INSERT;
                                   END;
                                   IF GLSetup."Global Dimension 1 Code" = DefDim."Dimension Code" THEN BEGIN
                                     "Global Dimension 1 Code" :=  DefDim."Dimension Value Code";
                                     MODIFY
                                   END;
                                   IF GLSetup."Global Dimension 2 Code" = DefDim."Dimension Code" THEN BEGIN
                                     "Global Dimension 2 Code" :=  DefDim."Dimension Value Code";
                                     MODIFY
                                   END;
    
                               UNTIL DefDim.NEXT = 0;
                             END;
    
          }
          SECTIONS
          {
            { PROPERTIES
              {
                SectionType=Body;
                SectionWidth=12000;
                SectionHeight=211;
              }
              CONTROLS
              {
              }
               }
          }
           }
      }
      REQUESTFORM
      {
        PROPERTIES
        {
          Width=9020;
          Height=3410;
        }
        CONTROLS
        {
        }
      }
      CODE
      {
        VAR
          DefDim@1000000000 : Record 352;
          LedgerDim@1000000001 : Record 355;
          GLSetup@1000000002 : Record 98;
    
        BEGIN
        END.
      }
    }
    
    


    If you don't have developer license, then commented out the code that modifies item ledger and Value Entry. You'll be able to run adjust cost routine, it just item ledges won't be updated. Which is ok, unless you run some reports.


        IF GLSetup."Global Dimension 1 Code" = DefDim."Dimension Code" THEN BEGIN
          "Global Dimension 1 Code" :=  DefDim."Dimension Value Code";
          MODIFY
        END;
        IF GLSetup."Global Dimension 2 Code" = DefDim."Dimension Code" THEN BEGIN
          "Global Dimension 2 Code" :=  DefDim."Dimension Value Code";
          MODIFY
        END;
    
    
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DnealDneal Member Posts: 103
    Thanks ara3n!

    I will try it out. :D
Sign In or Register to comment.