XMLPORT csv import file Shortcut Dim 3

kenjeskenjes Posts: 70Member
Hi

I have a csv file I import through XMLPORT.
In the file is a dimension value, that have to be inserted as ShortCut Dimension 3.
Table : "Job Journal Line"

Can someone help me out here ...

Thanks

Cheers
/Kenneth

Comments

  • kinekine Posts: 12,556Member
    And the problem is?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • kenjeskenjes Posts: 70Member
    How to set shortcut dimension 3
    Its not In the job journal Line table
  • rnjbngrnjbng Posts: 59Member
    Go to General ledger setup and first check what is shortcut dimension 3 code and then insert entry into Dimension set entry table for example
    glsetup.get;

    DimSet.reset;
    Dimset.init;
    dimset."dimension set id" := whatever the last no. is
    dimset."dimension code" := glsetup."shortcut dimension 3 code"
    dimset."dimension value code" := from your import file.
    dimset."dimension value Id" = if you have any from the file.
    dimset."dimension name := name of the dimension
    if not dimset.insert then
    dimset.modify;

    and you should get the shortcut dimension 3 dimension in...

    Cheers..
  • kinekine Posts: 12,556Member
    Do not agree with creating the dimset manually. You should create it through the management codeunit functions. And I am still not sure that this is answer for the request...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • kenjeskenjes Posts: 70Member
    To Kine : How to create it through the management codeunit ? :)
  • postsauravpostsaurav Posts: 708Member
    HI,

    If you inserting line via code then -
    1. Call Validate of the Shortcut Dimension Code Fields (1 & 2) if there is a value for those two.

    2. Once Validated you will get a dimension set ID for the Journal Line.

    3. Call Function -
    DimManagment.GetDimensionSet(TempDimSetEntry,DimSetID);
    

    Where -
    DimManagment - Variable of Codeunit 409.
    TempDimSetEntry - Temporary Variable of Dimension Set Entry Table.
    DimSetID - Dimension Set of ID of Current Line.

    ** This Function will fill up the Records in The Temporary Record of Dimension Set Entry.

    4. Once Done Add Your Shortcut Dimension 3 Value with a code like below in temp record set -
      TempDimSetEntry."Dimension Code" := DimVal."Dimension Code";
      TempDimSetEntry."Dimension Value Code" := DimVal.Code;
      TempDimSetEntry."Dimension Value ID" := DimVal."Dimension Value ID";
      IF TempDimSetEntry.INSERT THEN;
    

    5. After That call Function
    DimSetID := DimManagment. GetDimensionSetID(TempDimSetEntry);
    

    Where -
    DimManagment - Variable of Codeunit 409.

    The Dimension Set ID will be updated and the Line will contain value for Dimension Code 3...

    Let me know if any issues.

    Thanks & Regards,
    Saurav Dhyani

    Do you Know this About NAV?


    Connect - Twitter | Facebook | Google + | YouTube

    Follow - Blog | Facebook Page | Google + Page
  • jarnoldjarnold Posts: 1Member
    Thanks, Saurav. That was an extremely helpful bit of information. As usual, you are appreciated.
Sign In or Register to comment.