Did you found a solution for this?
If no please try this.
In the Gen. Journal Line (81) there is a function call NewLine. That is the function which control assigning numbers to the documents.
In that modify the code like below
IF GenJnlLine.FINDFIRST THEN BEGIN
"Posting Date" := LastGenJnlLine."Posting Date";
"Document Date" := LastGenJnlLine."Posting Date";
"Document No." := LastGenJnlLine."Document No.";
IF BottomLine AND
(Balance - LastGenJnlLine."Balance (LCY)" = 0) AND
NOT LastGenJnlLine.EmptyLine
THEN BEGIN
//"Document No." := NoSeriesMgt.GetNextNo(GenJnlBatch."No. Series","Posting Date",TRUE); // INCSTR("Document No.");
END;
END ELSE BEGIN
After that insert another new field type Bool to 81 table and then write below code in the Onvalidate Trigger
IF "New Line" = TRUE THEN BEGIN
GenJnlBatch01.RESET;
GenJnlBatch01.SETFILTER(GenJnlBatch01."Journal Template Name","Journal Template Name");
GenJnlBatch01.SETFILTER(GenJnlBatch01.Name,"Journal Batch Name");
IF GenJnlBatch01.FINDFIRST THEN BEGIN
"Document No." := NoSeriesMgt.GetNextNo(GenJnlBatch01."No. Series","Posting Date",TRUE); // INCSTR("Document No.");
END;
END ELSE BEGIN
IF CONFIRM('You have already assign a Document No. and If you proceed there will be a gap in the No. Series, Do you want to Proceed?', TRUE,TRUE) THEN BEGIN
END ELSE BEGIN
ERROR('Process Halt');
END;
END;
By doing this document No will only created at the time of user tick the new field.