Navision 2013 upgrading error (Step 2)

pablo1981pablo1981 Member Posts: 6
edited 2013-11-29 in NAV Three Tier
Hello everyone

I have the attached error migrating from Navision Navision 2009 R2 to 2013.
I'm throwing the page 104002, step 2

The customer has shared several tables in his database, including the table 169 (Job Ledger Entry).
The problem occurs on the codeunit 104048 within UpdateLedgerEntryDim function. The SQL is made up with the company name + '$' + table. But being shared this error process.

Would someone happened to this problem?,
Do you occasionally happen any possible solution?

Thank you very much for the help!

Answers

  • thegunzothegunzo Member Posts: 274
    edited 2013-10-28
    You will need to manually create the Dimension Set Id for each ledger entry and then remove all entries belonging to the job ledger entry from the ledger entry dimension table.

    Here is an example you could try do build your code on.
    UpdateLedgerEntryDim(VAR StateIndicator : Record "State Indicator")
    WITH JobLedgerEntry DO
      IF StateIndicator.UpdateTable(TABLENAME) THEN BEGIN   
        TimeLog.TimeLogInsert(TimeLog,TABLENAME,TRUE);
        IF FINDSET(TRUE) THEN REPEAT
          LedgerEntryDim.SETRANGE("Table ID",DATABASE::"Job Ledger Entry");
          LedgerEntryDim.SETRANGE("Entry No.","Entry No.");
          "Dimension Set ID" := GetLedgerEntryDimSetID(LedgerEntryDim);
          MODIFY;
        UNTIL NEXT = 0;    
        LedgerEntryDim.SETRANGE("Table ID",DATABASE::"Job Ledger Entry");
        LedgerEntryDim.DELETEALL;
    	LedgerEntryDim.RESET;
        TimeLog.TimeLogInsert(TimeLog,TABLENAME,FALSE);
        StateIndicator.EndUpdateTable(TABLENAME);
      END;
    
    WITH LedgerEntryDim DO
      IF StateIndicator.UpdateTable(TABLENAME) THEN BEGIN
        TimeLog.TimeLogInsert(TimeLog,TABLENAME,TRUE);
    	UpgradeDimEntry.UpgradeTable(
          DATABASE::"Ledger Entry Dimension",
          0);
        TimeLog.TimeLogInsert(TimeLog,TABLENAME,FALSE);
        StateIndicator.EndUpdateTable(TABLENAME);
      END;
      
    
    GetLedgerEntryDimSetID(VAR LedgerEntryDim : Record "Ledger Entry Dimension") DimSetID : Integer
    WITH LedgerEntryDim DO
      IF FINDSET THEN BEGIN
        REPEAT
          TempDimSetEntry.INIT;
          TempDimSetEntry."Dimension Code" := "Dimension Code";
          TempDimSetEntry."Dimension Value Code" := "Dimension Value Code";
          TempDimSetEntry.INSERT(TRUE);
        UNTIL NEXT = 0;
        DimSetID := DimMgt.GetDimensionSetID(TempDimSetEntry);
      END;
    
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • pablo1981pablo1981 Member Posts: 6
    Thank you Gunnar

    I will try it
  • pablo1981pablo1981 Member Posts: 6
    thegunzo wrote:
    You will need to manually create the Dimension Set Id for each ledger entry and then remove all entries belonging to the job ledger entry from the ledger entry dimension table.

    Here is an example you could try do build your code on.
    UpdateLedgerEntryDim(VAR StateIndicator : Record "State Indicator")
    WITH JobLedgerEntry DO
      IF StateIndicator.UpdateTable(TABLENAME) THEN BEGIN   
        TimeLog.TimeLogInsert(TimeLog,TABLENAME,TRUE);
        IF FINDSET(TRUE) THEN REPEAT
          LedgerEntryDim.SETRANGE("Table ID",DATABASE::"Job Ledger Entry");
          LedgerEntryDim.SETRANGE("Entry No.","Entry No.");
          "Dimension Set ID" := GetLedgerEntryDimSetID(LedgerEntryDim);
          MODIFY;
        UNTIL NEXT = 0;    
        LedgerEntryDim.SETRANGE("Table ID",DATABASE::"Job Ledger Entry");
        LedgerEntryDim.DELETEALL;
    	LedgerEntryDim.RESET;
        TimeLog.TimeLogInsert(TimeLog,TABLENAME,FALSE);
        StateIndicator.EndUpdateTable(TABLENAME);
      END;
    
    WITH LedgerEntryDim DO
      IF StateIndicator.UpdateTable(TABLENAME) THEN BEGIN
        TimeLog.TimeLogInsert(TimeLog,TABLENAME,TRUE);
    	UpgradeDimEntry.UpgradeTable(
          DATABASE::"Ledger Entry Dimension",
          0);
        TimeLog.TimeLogInsert(TimeLog,TABLENAME,FALSE);
        StateIndicator.EndUpdateTable(TABLENAME);
      END;
      
    
    GetLedgerEntryDimSetID(VAR LedgerEntryDim : Record "Ledger Entry Dimension") DimSetID : Integer
    WITH LedgerEntryDim DO
      IF FINDSET THEN BEGIN
        REPEAT
          TempDimSetEntry.INIT;
          TempDimSetEntry."Dimension Code" := "Dimension Code";
          TempDimSetEntry."Dimension Value Code" := "Dimension Value Code";
          TempDimSetEntry.INSERT(TRUE);
        UNTIL NEXT = 0;
        DimSetID := DimMgt.GetDimensionSetID(TempDimSetEntry);
      END;
    

    I tried your solution, Gunnar.
    It works fine!

    Thank you very much again
Sign In or Register to comment.