Adding a 9th Dimension Value during Gen Journal Import from Excel (NAV 2016)

I developed a journal import from excel (using a report and excel buffer) to import Journal entries from Excel Sheets for my client.
They already have 8 dimensions in Shortcut Dimensions 1 through 8, but they use 10 dimensions. During Import, sometimes the user will require the import to populate the 9th Dimension's values. Due to the Dimension Management code unit only able to handle the 8 shortcut dimensions, I am a little lost as to how to add the extra dimension and value to the dimension set while importing.
Any ideas would be welcome

Code extract : Check for Column 25 near end of code extract
REPEAT
  CASE ExcelBuf."Column No." OF

   1: BEGIN
      IF ISSERVICETIER THEN BEGIN
         EVALUATE(DateTime,ExcelBuf."Cell Value as Text");
         grecGenJnlLine."Posting Date" := DT2DATE(DateTime);
      END ELSE
         EVALUATE(grecGenJnlLine."Posting Date",ExcelBuf."Cell Value as Text");
      END;
   2: IF NOT "Use Document No. Series" THEN
        EVALUATE(grecGenJnlLine."Document No.",ExcelBuf."Cell Value as Text")
        ELSE
        AssignDocNo;

    3: BEGIN
        EVALUATE(grecGenJnlLine."Account Type",ExcelBuf."Cell Value as Text");
        grecGenJnlLine.VALIDATE("Account Type");
      END; 


    4: BEGIN
        EVALUATE(grecGenJnlLine."Account No.",ExcelBuf."Cell Value as Text");
        grecGenJnlLine."Account No." := DELCHR(grecGenJnlLine."Account No.",'=',',');
        grecGenJnlLine.VALIDATE("Account No.");
      END;
    5: BEGIN
        EVALUATE(grecGenJnlLine."Shortcut Dimension 1 Code",ExcelBuf."Cell Value as Text");//DIM1
        grecGenJnlLine.VALIDATE("Shortcut Dimension 1 Code");
       END;   

    6:BEGIN
        EVALUATE(grecGenJnlLine."Shortcut Dimension 2 Code",ExcelBuf."Cell Value as Text");//DIM2
        grecGenJnlLine.VALIDATE("Shortcut Dimension 2 Code");
      END;

    7:BEGIN // DIM3
        EVALUATE(lcodDimValue[3],ExcelBuf."Cell Value as Text");
        grecGenJnlLine.ValidateShortcutDimCode(3,lcodDimValue[3]);
      END; 

    8:BEGIN // DIM4
        EVALUATE(lcodDimValue[4],ExcelBuf."Cell Value as Text");
        grecGenJnlLine.ValidateShortcutDimCode(4,lcodDimValue[4]);
      END; 

    9:BEGIN // DIM5
        EVALUATE(lcodDimValue[5],ExcelBuf."Cell Value as Text");
        grecGenJnlLine.ValidateShortcutDimCode(5,lcodDimValue[5]);
      END; 

    10:BEGIN// DIM6
        EVALUATE(lcodDimValue[6],ExcelBuf."Cell Value as Text");
        grecGenJnlLine.ValidateShortcutDimCode(6,lcodDimValue[6]);
    END; 
    
    11:BEGIN // DIM7
        EVALUATE(lcodDimValue[7],ExcelBuf."Cell Value as Text");
        grecGenJnlLine.ValidateShortcutDimCode(7,lcodDimValue[7]);
    END;     

    12:BEGIN //DIM8
        EVALUATE(lcodDimValue[8],ExcelBuf."Cell Value as Text");
        grecGenJnlLine.ValidateShortcutDimCode(8,lcodDimValue[8]);
       END;
//    13:


//    14:


   15:EVALUATE(grecGenJnlLine."External Document No.",ExcelBuf."Cell Value as Text");//external document no

   16:EVALUATE(grecGenJnlLine.Description,ExcelBuf."Cell Value as Text");//Description

   17:EVALUATE(grecGenJnlLine.Description,ExcelBuf."Cell Value as Text");//Description

   18:
     BEGIN
      EVALUATE(grecGenJnlLine.Amount,ExcelBuf."Cell Value as Text");
      grecGenJnlLine.VALIDATE(Amount);
     END;

   19:
     BEGIN
      EVALUATE(grecGenJnlLine."Bal. Account Type",ExcelBuf."Cell Value as Text");
      grecGenJnlLine.VALIDATE("Bal. Account Type");
     END;

   20:
   BEGIN
    EVALUATE(grecGenJnlLine."Bal. Account No.",ExcelBuf."Cell Value as Text");
    grecGenJnlLine."Bal. Account No." := DELCHR(grecGenJnlLine."Bal. Account No.",'=',',');
    grecGenJnlLine.VALIDATE("Bal. Account No.");
   END;

   21://Currency Code
   BEGIN
    EVALUATE(grecGenJnlLine."Currency Code",ExcelBuf."Cell Value as Text");
    grecGenJnlLine.VALIDATE("Currency Code");
   END;

   23://ALLOCATION
   BEGIN
    EVALUATE(grecGenJnlLine."Allocation Code",ExcelBuf."Cell Value as Text");
    grecGenJnlLine.VALIDATE("Allocation Code");
   END;

 //    25://DIM9
 //     BEGIN 
 //        EVALUATE(lcodDimValue[9],ExcelBuf."Cell Value as Text");
 //        grecGenJnlLine.ValidateShortcutDimCode(9,lcodDimValue[9]);
 //       END;
 

     END;
 UNTIL ExcelBuf.NEXT = 0;

Sign In or Register to comment.