Hello,
I am working on Standard NAV 5 (CH version)
I have the following situation:
I set up a job (JJJ) with one Dimension (DDD), one dimension value (VVV) and I put "same code" on the validation tab.
Then I open a Purchase Invoice, specify the job JJJ in the line and I fill the dimension with the same dimension code (XXX) I put above.
When I post the invoice I get this message :
"Select Dimension value Code XXX for the Dimension Code AAA for Job JJJ"
I have checked to see where the poblem is and it seems that the job journal line created from the purchase line has no Dimension set...
Has anyone had the same problem and fixed it ?
Thank you in advance
Comments
did you already fix that?
http://www.mibuso.com/dlinfo.asp?FileID=1123
e tutto funziona!
bye
http://www.mibuso.com/dlinfo.asp?FileID=1123
Codeuni 90 -
PROCEDURE OnRun()
Deleted VAR: TempJnlLineDim2@1021 : TEMPORARY Record 356;
CASE PurchLine.Type OF
PurchLine.Type::"G/L Account":
IF (PurchLine."No." <> '') AND NOT PurchLine."System Created Entry" THEN BEGIN
GLAcc.GET(PurchLine."No.");
GLAcc.TESTFIELD("Direct Posting");
//Old Code Begin
TempJnlLineDim2.RESET;
TempJnlLineDim2.DELETEALL;
DimMgt.CopyJnlLineDimToJnlLineDim (TempJnlLineDim,TempJnlLineDim2);
IF PurchLine."Job No." <> '' THEN
JobPostLine.InsertPurchLine(PurchHeader,PurchInvHeader,PurchCrMemoHeader,JobPurchLine,SrcCode,TempJnlLineDim2);
//Old Code End
...
CASE PurchLine.Type OF
PurchLine.Type::"G/L Account":
IF (PurchLine."No." <> '') AND NOT PurchLine."System Created Entry" THEN BEGIN
GLAcc.GET(PurchLine."No.");
GLAcc.TESTFIELD("Direct Posting");
//New code begin
IF PurchLine."Job No." <> '' THEN BEGIN
TempDocDim.RESET;
TempDocDim.SETRANGE("Table ID",DATABASE::"Purchase Line");
TempDocDim.SETRANGE("Line No.",PurchLine."Line No.");
DimMgt.CopyDocDimToJnlLineDim(TempDocDim,TempJnlLineDim);
JobPostLine.InsertPurchLine(PurchHeader,PurchInvHeader,PurchCrMemoHeader,JobPurchLine,SrcCode,TempJnlLineDim);
END;
New Code end
...
PROCEDURE PostItemJnlLine@2(PurchLine@1000 : Record 39;QtyToBeReceived@1001 : Decimal;QtyToBeReceivedBase@1002 : Decimal;QtyToBeInvoiced@1003 : Decimal;QtyToBeInvoicedBase@1004 : Decimal;ItemLedgShptEntryNo@1005 : Integer;ItemChargeNo@1006 : Code[20];TrackingSpecification@1010 : Record 336) : Integer;
Deleted local VAR: TempJnlLineDim2@1021 : TEMPORARY Record 356;
Added Global VAR: TempJnlLineDim:TEMPORARY Record 356;
//Old Code Begin
TempDocDim.RESET;
TempDocDim.SETRANGE("Table ID",DATABASE::"Purchase Line");
TempDocDim.SETRANGE("Line No.","Line No.");
DimMgt.CopyDocDimToJnlLineDim(TempDocDim,TempJnlLineDim);
OriginalItemJnlLine := ItemJnlLine;
TempJnlLineDim2.RESET;//deleted line
TempJnlLineDim2.DELETEALL;//deleted line
DimMgt.CopyJnlLineDimToJnlLineDim(TempJnlLineDim,TempJnlLineDim2);//deleted line
ItemJnlPostLine.RunWithCheck(ItemJnlLine,TempJnlLineDim);
...
//Old code end
//New code begin
...
TempDocDim.RESET;
TempDocDim.SETRANGE("Table ID",DATABASE::"Purchase Line");
TempDocDim.SETRANGE("Line No.","Line No.");
DimMgt.CopyDocDimToJnlLineDim(TempDocDim,TempJnlLineDim);
OriginalItemJnlLine := ItemJnlLine;
ItemJnlPostLine.RunWithCheck(ItemJnlLine,TempJnlLineDim);
...
//New Code end
//Old Code Begin
...
JobPostLine.GetStartItemLedgEntryNo;
ItemJnlPostLine.RunWithCheck(ItemJnlLine2,TempJnlLineDim);
JobPostLine.InsertPurchLine(PurchHeader,PurchInvHeader,PurchCrMemoHeader,PurchLine,SrcCode,TempJnlLineDim2);//deleted line
END;
...
//Old code end
//New Code begin
...
JobPostLine.GetStartItemLedgEntryNo;
ItemJnlPostLine.RunWithCheck(ItemJnlLine2,TempJnlLineDim);
JobPostLine.InsertPurchLine(PurchHeader,PurchInvHeader,PurchCrMemoHeader,PurchLine,SrcCode,TempJnlLineDim); //added line
END;
...
//New Code end
I had the same problem, chrisdf, and applied the code you have told us.
The problem of "Same Code" dimension value is fixed, but now I have another problem:
The problem is when I try to Post an order with more than one line, with the same "Job No." and "Job Task No." .
You can test it and see the error it occurs:
when it's processing the second line ... we obtain the error:
"The journal line dimension already exists.
Identification field and values:
Table Id='39',Journal Template Name='',Journal Batch Name='',Journal Line No.='0',Dimension Code='DEPARTMENT'
Am I missing anything?
Thank you in advance
I've got the same problem as borjagh and i don't know how to solve it.
Did anybody find a solution ?
Thank you
Can you explain your particular scenario more as well