recGenJnlLine.RESET; recGenJnlLine.SETRANGE("Student No.", Rec.SDMSID); recGenJnlLine.SETRANGE("Journal Template Name", 'CASH RECEI'); recGenJnlLine.SETRANGE("Journal Batch Name", CurrForm.subform1.FORM.GetCurrBatch2); IF recGenJnlLine.FINDFIRST THEN BEGIN vBatchName2 := CurrForm.subform1.FORM.GetCurrBatch2; //frmCashReceipts.PostRec(recGenJnlLine,vBatchName2); CurrForm.subform1.FORM.PostRec(recGenJnlLine,vBatchName2); END;
CODEUNIT.RUN(CODEUNIT::"Gen. Jnl.-Post",recGenJnlLine); CurrentJnlBatchName := GETRANGEMAX("Journal Batch Name"); COMMIT;
Comments
Is it really NAV's standard when for example 2 users try to post a journal at the same time to tablelock/deadlock?
I would recommend to use CU13 "Gen. Jnl.-Post Batch" instead of posting each journal line separately. It contains all the locking and preliminary checks. This should avoid the locking problem (among others).
with best regards
Jens
RIS Plus, LLC