Hi all,
I need to post two more Records in G/L Entry table in the time of posting the "Transfer Order Receipt" in Navision.
So I have added insertion (General Journal Line Table) code in "5705-TransferOrder-Post Receipt" codeunit.
But when I see by using Debugger, its getting skip on the RunGenJnlPostLine Line code. It wont execute.
Pls provide me a solution for that issue. Give me a Procedure for this requirement.
Thanks
Victory is sweetest when you've known defeat
0
Comments
GD
GenJnlLine.INIT;
GenJnlLine."Posting Date" := TransHeader."Posting Date";
GenJnlLine."Document Date" := TransHeader."Posting Date";;
GenJnlLine."Document No." := TransRcptHeader."No.";
GenJnlLine."Document Type" := GenJnlLine."Document Type"::" ";
GenJnlLine."Account Type":=GenJnlLine."Account Type"::"G/L Account";
GenJnlLine."Account No." := '2020';
GenJnlLine."System-Created Entry" := TransferBuffer[1]."System-Created Entry";
GenJnlLine.Amount := -TransferBuffer[2].Amount;
GenJnlLine."Bal. Account Type":=GenJnlLine."Bal. Account Type"::"G/L Account";
GenJnlLine."Bal. Account No.":='2040';
GenJnlLine."Shortcut Dimension 1 Code" := TransferBuffer[1]."Global Dimension 1 Code";
GenJnlLine."Shortcut Dimension 2 Code" := TransferBuffer[1]."Global Dimension 2 Code";
GenJnlLine.Description := STRSUBSTNO(Text13702,TransRcptHeader."No.");
IF GenJnlLine.Amount <> 0 THEN
RunGenJnlPostLine(GenJnlLine,TransferBuffer[1]."Dimension Entry No.");
END;
I have added those code in "Transfer Order Receipt codeunit" after the "Post G/L Entries" comment.
Pls do the needful.
Thanks,
1) Are you sure "GenJnlLine.Amount" has an amount <> 0?
2) The "END" is NOT a part of the "IF-THEN" but belongs to another block that is started before your code.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
And i wrongly sent that "END" Statement.
My code is
IF GenJnlLine.Amount <> 0 THEN
RunGenJnlPostLine(GenJnlLine,TransferBuffer[1]."Dimension Entry No.");
thats it,
I could not able to understand that Transfer Buffer Table use.
Or Should I copy from existing Transfer Buffer Table to new table or anything? Pls suggest me.
Thanks
There's nothing wrong with your code as you have written it, if the amount is not zero, the line has to execute...
Curious to know what 2 extra lines are for and that too in G/L entry. Can you explain what exactly these 2 lines are for? May be we can suggest some other solution.
http://ssdynamics.co.in
check the value of
-TransferBuffer[2].Amount;
GD