Hi all,
I have a question:
I created a new codeunit to do a posting routine. My codeunit creates Gen. Journal Lines through genjnlline.init
I need to post this lines into the G/L ledger table. To achieve this i have called the genjnlLine.runwithcheck function.
The problem is this function takes two parameters: a gen. jnl. Line record and a Temp. jnl Line Dim. record.
But i have not included dimensions in my customizations. Do anyone have an idea how i can post this lines without dimensions?
Thanks for any contributions.
0
Answers
My Blog - nav.education
I have tried. it worked fine for a while but after a while it gives an error: 'this Ledger entry dimensions exists already' and it shows some values. I tried to find the bug. and i discovered that when table "Journal Line Dimension" is empty all works fine. but if it contains records i have my error
I have done this:
CLEAR(TempjnlLineDim1);
TempjnlLineDim1.INIT ;
TempjnlLineDim1."Table ID" := 81;
TempjnlLineDim1."Journal Template Name" := GnlJnlLine."Journal Template Name";
TempjnlLineDim1."Journal Batch Name" := GnlJnlLine."Journal Batch Name";
TempjnlLineDim1."Journal Line No." := GnlJnlLine."Line No.";
TempjnlLineDim1."Allocation Line No." := 0;
TempjnlLineDim1."Dimension Code" := ' ';
genjnlpostline.RunWithCheck(GnlJnlLine,TempjnlLineDim1);
but i still have my error:
"The Ledger Entry Dimension already exists.
Identification fields and values Table ID='17' ,Entry No.='3118', Dimension Code= 'ACHETEUR'"
INIT instruction does not clear the Primary Key fiels, maybe there are some dirty variables somewhere;
try to do a if this does not work either, try to insert a jnl line w/o dimension, enable debug and post it: you should be able to see how the tempjnl is (not) evaluated in the runwithcheck function
P.S.: you should test if you have to clear the variable, if, for example, for some lines you have to insert dimensions, and for some others not.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
TempjnlLineDim1.deleteall;
moreover, to the onrun, you have only to pass the journal line, and not the dimension table!
EDIT: david is somewhat faster: because in the onrun you'll find:
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
You are welcome. Its great to see someone posting vaild information and asking the question correctly. Makes it soooooo much easier for us to answer that way. \:D/