Import Beginning Balances with Dimensions

aadamsaadams Member Posts: 19
edited 2013-09-05 in NAV Three Tier
Hello,

My company is in the process of implementing NAV 2013 and I'm tasked with importing our opening balances. I had done this before in NAV 2009, but apparently the Dimensions are drastically different now and I'm running into a few glitches.

I'm developing an XMLPort that imports a text file containing the basic G/L Acct, debit, credit and a couple dimension values. My understanding of the new dimension set entry is limited, but I was under the impression that I would need to:

1. Insert the Journal line
2. Make sure the Dimension code/value exists (insert if not)
3. Insert a dimension set entry record with the Dim set id from the Journal Line table for each dimension

Here's a sample of how I'm currently attempting this:
Insert Journal line:
GenJournLine.TRANSFERFIELDS("Gen. Journal Line");

GenJournLine."Line No." := LineNo;
GenJournLine."Journal Template Name" := TemplateName;
GenJournLine."Journal Batch Name" := BatchName;
GenJournLine.VALIDATE("Account Type","Gen. Journal Line"."Account Type"::"G/L Account");

GenJournLine.INSERT(TRUE);
If dimension value does not exist, create it (this is done for each dimension I want to attach to the journal line).
IF NOT DimValue.GET('CUSTS',CustDim) THEN BEGIN
DimValue.INIT;
DimValue.VALIDATE("Dimension Code",'CUSTS');
DimValue.VALIDATE(Code,CustDim);
DimValue.INSERT(TRUE);
END;
Now insert the dimension set entry
JnlLineDimension.VALIDATE("Dimension Code",'CUSTS');
JnlLineDimension.VALIDATE("Dimension Value Code",CustDim);
JnlLineDimension.VALIDATE("Dimension Value ID",DimValue."Dimension Value ID");
JnlLineDimension."Dimension Set ID" :=  GenJournLine."Dimension Set ID";
JnlLineDimension.INSERT(TRUE);

When I run this I get an error that I don't have "insert" permissions on the Dimension Set Entry table.

I must be doing it wrong, but I cannot find any resources that help point me in the right direction. Any help would be appreciated.

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
  • BardurKnudsenBardurKnudsen Member, Microsoft Employee Posts: 137
    If you cannot use RapidStart, then do it along these lines:


    // declare TempDimensionSetEntry as a temp record 480
    // repeat this for each value
    TempDimensionSetEntry.init;
    TempDimensionSetEntry.validate("Dimension Code",< some dimension code>);
    TempDimensionSetEntry.validate("Dimension Value Code",<some new value>);
    TempDimensionSetEntry.insert(true);

    // and then use codeunit 408 to retrieve the dimension set id:
    JournlLine."Dimension Value ID" := DimMgt.GetDimensionSetID(TempDimensionSetEntry);

    DimMgt will automatically create a new dimension set id if it didn't exist already.
    Bardur Knudsen
    Microsoft - Dynamics NAV
  • mdPartnerNLmdPartnerNL Member Posts: 802
    Both answers should be in tips.. thx
  • aadamsaadams Member Posts: 19
    Thanks for the replies, and sorry for the late response.

    I ended up just stuffing the dimensions into shortcut dimensions, which worked. I wasn't able to use the RapidStart because we are making various changes (COA changes) and needed to incrementally import/test the data. Our NAV reseller advised that RapidStart wouldn't be able to handle that without customization.

    @mohana_cse06, I had actually watched that video before I posted the question. I was not able to get that working either. I didn't have the same packages as the guy in the video, and was encountering errors when I tried to set them up (can't recall the exact details, but I'm sure I was doing it wrong).

    @BardurKnudsen, There was another post somewhere using that method, which I had attempted without success (same permission error at the TempDimensionSetEntry.insert(true) part). I will definitely try this again next time.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    The packages are the standard Packages released with NAV2013 Base Database.
Sign In or Register to comment.