Item Journal Line Dimensions
Toddy_Boy
Member Posts: 232
There are two short dimension codes 4 OVEN and 5 OPERATIVE which are assigned to an item journal line. The codes are validated as such where Rec is "Item Journal Line"
Rec.ValidateShortcutDimCode(5, ShortcutDimCode[5]);
Rec.ValidateShortcutDimCode(4, ShortcutDimCode[4]);
The values returned into the dimension code array are perfectly valid as I can see in the debugger, however only the OPERATIVE (dimension code 5) is actually written to the Ledger Entry Dimension table when posting the journal line. The OVEN code is ignored :-k
Is there something that tells Navision to write the value of a dimension code to the Ledger Entry Dimension table or could I be looking in the wrong place for the other dimension code? ](*,) ](*,) ](*,)
Cheers
Rec.ValidateShortcutDimCode(5, ShortcutDimCode[5]);
Rec.ValidateShortcutDimCode(4, ShortcutDimCode[4]);
The values returned into the dimension code array are perfectly valid as I can see in the debugger, however only the OPERATIVE (dimension code 5) is actually written to the Ledger Entry Dimension table when posting the journal line. The OVEN code is ignored :-k
Is there something that tells Navision to write the value of a dimension code to the Ledger Entry Dimension table or could I be looking in the wrong place for the other dimension code? ](*,) ](*,) ](*,)
Cheers
Life is for enjoying ... if you find yourself frowning you're doing something wrong
0
Comments
-
Could you pate the code on how you are populating the journal line and how you are posting it. Calling Cu 22.0
-
Here you go
ProdOrderLine.SETRANGE("Prod. Order No.", OrderNo); ProdOrderLine.SETRANGE("Item No.", No); IF ProdOrderLine.FINDSET(FALSE, FALSE) THEN BEGIN // create a journal line Rec.SetUpNewLine(xRec); Rec.VALIDATE("Line No.",10000); //CP002 Rec.VALIDATE("Entry Type","Entry Type"::Output); Rec.VALIDATE("Prod. Order No.", OrderNo); Rec.INSERT(TRUE); Rec.VALIDATE("Item No.", "CP General Procs".RoutingLineItem(OrderNo,No,OperationNo)); Rec.VALIDATE("Operation No.", OperationNo); Rec.VALIDATE("Output Quantity", OutputQuantity); Rec."Prod. Order Line No." := ProdOrderLine."Line No."; Rec.ValidateShortcutDimCode(5, ShortcutDimCode[5]); Rec.ValidateShortcutDimCode(4, ShortcutDimCode[4]); Rec.Finished := JobFinished; Rec.MODIFY(TRUE); ClearDown(); CurrForm.txtBarCodeID.ACTIVATE(); END ELSE ERROR('Cannot find the Item %1 in Production Order %2.',No, OrderNo);[/code]Life is for enjoying ... if you find yourself frowning you're doing something wrong0 -
This is an example code I did based on yours and it works.
xItemJnlLine.GET('ITEM','DEFAULT',10000); ItemJnlLine."Journal Template Name" := 'item'; ItemJnlLine."Journal Batch Name" := 'DEFAULT'; ItemJnlLine.VALIDATE("Line No.",20000); //CP002 ItemJnlLine.VALIDATE("Entry Type",ItemJnlLine."Entry Type"::Output); ItemJnlLine.INSERT(TRUE); ItemJnlLine.SetUpNewLine(xItemJnlLine); ShortcutDimCode[5] := 'HOME'; ShortcutDimCode[4] := '70'; ItemJnlLine.ValidateShortcutDimCode(5, ShortcutDimCode[5]); ItemJnlLine.ValidateShortcutDimCode(4, ShortcutDimCode[4]); ItemJnlLine.MODIFY(TRUE);
Make sure you change your sequence of code based on above sample and make sure shortcutdimcode is populated.0 -
Thanks for the reply but I'm still having trouble
I get an error 'There is nothing to post', I have reapplied various lines to get the output quantity (did I mention I'm trying to perform an Output Journal :-k ), then the production order number, operation number and item number (I seem to be back at square one with the code) but still no dimension 4 (OVENS) appearing in the Ledger Entry Dimension - is this the correct table to be looking in.
I am using CU 22 to post the journal line.
I have tried to do a standard output journal and that is NOT storing the OVENS dimension code. Which leads me to believe something is not set up correctly with this dimension. Any ideas where I can check?
[/b]Life is for enjoying ... if you find yourself frowning you're doing something wrong0 -
How are you calling CU 22. I don't see the code, you need to call it
CU22.runwithcheck(ItemJournal,JournalDim);
JournalDim would be your dimension,
Also you do not need to insert the Item Journal.0 -
What about the fact the dimension code 4 doesn't post when using the default screen?
CU 22 is called by CODEUNIT.RUN(CODEUNIT::"Item Jnl.-Post",Rec);
Would I call CU22.runwithcheck(ItemJournal,JournalDim); instead of the code aboveLife is for enjoying ... if you find yourself frowning you're doing something wrong0 -
Yes, you need to call run with check and pass the Dimension.
Also you do not need to insert or modify the Item Journal you are creating. So comment those out. Create a temporary JournalDim record variable and populate it with dimensions and pass it to runwithcheck0 -
Hi Ara3n thanks for your continued help but not quite there yet.
This has had a little extra work done because I was getting invalid production routing line but it is essentially the same as the sample code you provided. Instead of one problem I now have 2 problems
The OPERATIVES dimension 5 now posts a blank value
The OVENS dimension 4 still does not post at all - no value, no code, no entry in the Ledger Entry Dimension table, nothing.
](*,) ](*,)IF xItemJnlLine.GET('OUTPUT','CNC1',10000) THEN ; ItemJnlLine.INIT; ItemJnlLine."Journal Template Name" := 'OUTPUT'; ItemJnlLine."Journal Batch Name" := CurrentJnlBatchName; ItemJnlMgt.SetName(CurrentJnlBatchName,ItemJnlLine); ItemJnlLine.SetUpNewLine(xItemJnlLine); ItemJnlLine.VALIDATE("Line No.",100000); ItemJnlLine.VALIDATE("Entry Type", ItemJnlLine."Entry Type"::Output); ItemJnlLine.VALIDATE("Prod. Order No.", OrderNo); ItemJnlMgt.GetOutput(ItemJnlLine,ProdOrderDescription,OperationName); ItemJnlLine.VALIDATE("Item No.", "CP General Procs".RoutingLineItem(OrderNo,No,OperationNo)); ItemJnlMgt.OnAfterInputItemNo(No); ItemJnlLine.VALIDATE("Operation No.", OperationNo); ItemJnlMgt.GetOutput(ItemJnlLine,ProdOrderDescription,OperationName); ItemJnlLine.VALIDATE("Output Quantity", OutputQuantity); ItemJnlLine.ValidateShortcutDimCode(5, ShortcutDimCode[5]); ItemJnlLine.ValidateShortcutDimCode(4, ShortcutDimCode[4]); ItemJnlLine.Finished := JobFinished; JournalDimension.RESET; JournalDimension.DELETEALL; JournalDimension.INIT; JournalDimension."Table ID" := 83; JournalDimension."Journal Template Name" := 'OUTPUT'; JournalDimension."Journal Batch Name" := CurrentJnlBatchName; JournalDimension."Journal Line No." := ItemJnlLine."Line No."; JournalDimension."Dimension Code" := 'OVENS'; JournalDimension."New Dimension Value Code" := ShortcutDimCode[4]; JournalDimension.INSERT; JournalDimension.INIT; JournalDimension."Table ID" := 83; JournalDimension."Journal Template Name" := 'OUTPUT'; JournalDimension."Journal Batch Name" := CurrentJnlBatchName; JournalDimension."Journal Line No." := ItemJnlLine."Line No."; JournalDimension."Dimension Code" := 'OPERATIVES'; JournalDimension."New Dimension Value Code" := ShortcutDimCode[5]; JournalDimension.INSERT; "Item Jnl.-Post Line".RunWithCheck(ItemJnlLine,JournalDimension);]Life is for enjoying ... if you find yourself frowning you're doing something wrong0 -
I don't see where do you assign values to ShortcutDimCode[5] and ShortcutDimCode[4]? :-k0
-
I use
JournalDimension."Dimension Value Code" := ShortcutDimCode[4];
instead of
JournalDimension."New Dimension Value Code" := ShortcutDimCode[4];
Regards0 -
Guys thanks for the suggestion but still no further along.

ar4ijs - The ShortcutDimCode[4] and ShortcutDimCode[5] are global variables assigned on a card
JedrzejT - no change
I'm still confused why the dimension code 4 will not post through the standard Output Journal card 99000823. Can anyone shed some light on why this would not happen?
Do all dimensions post to the Ledger Entry Dimension table? :-kLife is for enjoying ... if you find yourself frowning you're doing something wrong0 -
Few more tips:
1. RemoveItemJnlLine.ValidateShortcutDimCode(5, ShortcutDimCode[5]); ItemJnlLine.ValidateShortcutDimCode(4, ShortcutDimCode[4]);
2. Put ItemJnlLine.INSERT(TRUE); before inserting dims.
3. Use JournalDimension."Dimension Value Code" instead of JournalDimension."New Dimension Value Code", and try to insert it with TRUE.0 -
Close but no cigar.
The OPERATIVES dimension 5 populates but the OVENS dimension does not appear in the Ledger Entry Dimension table. I think this is either a bug or a setup issue as previously in this post I mentioned this does not work from the default card.
Any ideas where I can check if it is a setup issue?
I am using UK Dynamics NAV 5 if thats any help.[/b]Life is for enjoying ... if you find yourself frowning you're doing something wrong0 -
It must work. If you send me the .fob to msn e-mail, I will take a closer look :shock: .0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
