Dear Sir,
I have created multiple Lines thru code & now I want to Post the same in a Single Shot thru code itself.
How to Do it ?
Code given below for your review.IF RecordAVR.FINDSET THEN
REPEAT
GenJnlLine2.INIT
....
....
....
UNTIL RecordVAR.NEXT =0;
CODEUNIT.RUN(CODEUNIT::"Gen. Jnl.-Post Line", GenJnlLine2); //GenJnlLine2 has multiple Lines
The above code posts only the First Line. What is the issue in the above code.
Kindly reply.
Regards,
navuser1
Answers
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
You can use loop without GenJnlLine2.INSERT; (and without Template, Batch and Line No.) and post line by line. This approach can be used only if each line has Account and Balance Account part.
Thanks for your reply.
If I call Gen. Jnl.-Post Line Codeunit within the loop, then it generates different "Transaction No." in the G/L Entry for the same Document No.
My goal is to achieve the single "Transaction No." for the multiple Gen. Journal Lines where all have the same "Document No."
Thanks for your reply. I will follow this one first then back to you.
Every Line is balanced ( Balancing Account is given in every Line)