Automatic Posting

DivyaDivya Member Posts: 125
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

Comments

  • gulamdastagirgulamdastagir Member Posts: 411
    post the code with your code marked in red
    Regards,

    GD
  • DivyaDivya Member Posts: 125
    Hi,
    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,
    Victory is sweetest when you've known defeat
  • krikikriki Member, Moderator Posts: 9,110
    Check a few things:
    1) Are you sure "GenJnlLine.Amount" has an amount <> 0?
    2)
    IF GenJnlLine.Amount <> 0 THEN
    RunGenJnlPostLine(GenJnlLine,TransferBuffer[1]."Dimension Entry No.");
    END;
    
    The "END" is NOT a part of the "IF-THEN" but belongs to another block that is started before your code.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • DivyaDivya Member Posts: 125
    S. Iam sure that Amount is not equal to Zero.
    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
    Victory is sweetest when you've known defeat
  • AlishaAlisha Member Posts: 217
    The amount on your Gen. Jnl Line is coming from that table.. so how's that you don't understand it?

    There's nothing wrong with your code as you have written it, if the amount is not zero, the line has to execute...
  • ssinglassingla Member Posts: 2,973
    I need to post two more Records in G/L Entry table in the time of posting the "Transfer Order Receipt" in Navision.

    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.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • gulamdastagirgulamdastagir Member Posts: 411
    GenJnlLine.Amount := -TransferBuffer[2].Amount; 
    


    check the value of
    -TransferBuffer[2].Amount;
    Regards,

    GD
Sign In or Register to comment.