I'm trying to insert 100 general lines in general journal, but the documnet no is not increment
here's my code
Integer - OnPreDataItem()
Integer.SETRANGE(Number,1,10);
GenJournalLine.SETRANGE("Journal Batch Name",'DEFAULT');
GenJournalLine.SETRANGE("Journal Template Name",'GENERAL');
IF GenJournalLine.FINDLAST THEN
Line:=GenJournalLine."Line No.";
Integer - OnAfterGetRecord()
GenJournalLine.INIT;
GenJournalLine."Journal Batch Name":='DEFAULT';
GenJournalLine."Journal Template Name":='GENERAL';
Line:=Line+10000;
GenJournalLine."Line No.":=Line;
GenJournalLine."Posting Date":=022819D;
GenJournalLine."Document Type":=GenJournalLine."Document Type"::Payment;
//GenJournalLine."Document No.":=GenJournalLine."Document No.";
GenJournalLine."Account Type":=GenJournalLine."Account Type"::"G/L Account";
GenJournalLine."Account No.":='11200';
GenJournalLine.VALIDATE("Account No.",'11200');
GenJournalLine.INSERT(TRUE);
0
Answers
Do you want me to call that function??
Can you explain in detail.
Integer.SETRANGE(Number,1,10);
LastGenJournalLine.SETRANGE("Journal Batch Name",'DEFAULT');
LastGenJournalLine.SETRANGE("Journal Template Name",'GENERAL');
IF LastGenJournalLine.FINDLAST THEN
Line:=LastGenJournalLine."Line No.";
Integer - OnAfterGetRecord()
GenJournalLine.INIT;
GenJournalLine."Journal Batch Name":='DEFAULT';
GenJournalLine."Journal Template Name":='GENERAL';
Line:=Line+10000;
GenJournalLine."Line No.":=Line;
GenJournalLine.SetUpNewLine(LastGenJournalLine, 0, TRUE);
GenJournalLine."Posting Date":=022819D;
GenJournalLine."Document Type":=GenJournalLine."Document Type"::Payment;
//GenJournalLine."Document No.":=GenJournalLine."Document No.";
GenJournalLine."Account Type":=GenJournalLine."Account Type"::"G/L Account";
GenJournalLine."Account No.":='11200';
GenJournalLine.VALIDATE("Account No.",'11200');
GenJournalLine.INSERT(TRUE);
LastGenJournalLine := GenJournalLine;
I'm getting this error
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Thnak you AlexeyShamin