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"
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...
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...
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;
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Its not In the job journal Line table
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..
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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 -
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 -
5. After That call Function
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