Importing Secondary Dimension in Gen. Journal Line table

rnjbng
Member Posts: 82
Hi -
In a .csv file I have a column Project Code which is a shortcut dimension 4. In my XMLPORT is there any way i can just validate a field in the Gen. Journal table and get this secondary dimension into the Dimension set entry table or do I have to something else.
Any help is highly appreciate.
Thanks
RJ.
In a .csv file I have a column Project Code which is a shortcut dimension 4. In my XMLPORT is there any way i can just validate a field in the Gen. Journal table and get this secondary dimension into the Dimension set entry table or do I have to something else.
Any help is highly appreciate.
Thanks
RJ.
0
Best Answer
-
Show your code, it'll be easier to identify the problem5
Answers
-
I found this code in this blog but it does not seem to work.
IF DimVal.GET(GLSetup."Shortcut Dimension 3 Code",ProjectDim) THEN BEGIN
DimManagment.GetDimensionSet(TempDimSetEntry,GenJnlLine."Dimension Set ID");
TempDimSetEntry."Dimension Set ID" := GenJnlLine."Dimension Set ID";
TempDimSetEntry."Dimension Code" := DimVal."Dimension Code";
TempDimSetEntry."Dimension Value Code" := DimVal.Code;
TempDimSetEntry."Dimension Value ID" := DimVal."Dimension Value ID";
IF TempDimSetEntry.INSERT THEN;
GenJnlLine."Dimension Set ID" := DimManagment. GetDimensionSetID(TempDimSetEntry);
END;
Any help appreciated.
Thanks
RJ.0 -
You need to change the 1st line to "Shortcut Dimension 4 Code" (currently it's 3). Also make sure you have done a...
GLSetup.GET;
...right at the start.0 -
Hi Kishorm -
I have put a code in there Glsetup.get and shortcut dimension 3 code is my project code which is absolutely correct. Still it won't work.
Thanks
RJ.0 -
In my initial post I made a mistake as Shortcut dimension 4 code, its shortcut dimension 3 code. Sorry for the typo.0
-
Where have you put the code? It should be placed in the OnBeforeInsertRecord Trigger.
Also is your DataItem called GenJnlLine?0 -
Yes, the code is onBeforeInsertRecord and GenjnlLine is a variable referring to Gen. Journal line table. My Dataitem is Integer0
-
It's probably because when you insert the GenJnlLine it calculates and sets the Dimension Set ID at that point. Add the above code after you have inserted your GenJnlLine and then do a GenJnlLine.MODIFY at the end of it.0
-
Hi Kishorm - I tried everything and still no luck. Its importing now but whatever value is in the first line it gets replicated to the following lines...0
-
Show your code, it'll be easier to identify the problem5
-
Hi Kishor - Sorry for the delay in getting back to you, I was able to resolve the issue and its working now. Thanks for all your help.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions