i need to make code to check value for External Document No. in enter the value in journals or while posting the journal line to checks the value if its already posted in G/L Entry or not.
Hi @Suhail
If can use OnBeforePostGenJnlLine then I can guess that you run a NAV 2016 or newer ?
It is very important to specify your version, if you want a good answer. I cannot guess if it is C/AL or AL you are using.
Do not be afraid to crash the system, your properly will do this more than one time, but you will learn from this
Create a event subscriper from codeunit 12 OnBeforePostGenJnlLine .
Declare a local record of G/L Entry.
GLEntry.reset;
GLEntry.SetRange("External Document No.",GenJournalLine."External Document No.");
if not GLEntry.IsEmpty then
Error('Your very own error message');
For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
i didn't try yet, im new in NAV and afraid to crash the system, all i know to put the condition code inside CodeUnit 12 in OnBeforePostGenJnlLine event
Hi @Suhail
If can use OnBeforePostGenJnlLine then I can guess that you run a NAV 2016 or newer ?
It is very important to specify your version, if you want a good answer. I cannot guess if it is C/AL or AL you are using.
Do not be afraid to crash the system, your properly will do this more than one time, but you will learn from this
Create a event subscriper from codeunit 12 OnBeforePostGenJnlLine .
Declare a local record of G/L Entry.
GLEntry.reset;
GLEntry.SetRange("External Document No.",GenJournalLine."External Document No.");
if not GLEntry.IsEmpty then
Error('Your very own error message');
For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
Answers
If can use OnBeforePostGenJnlLine then I can guess that you run a NAV 2016 or newer ?
It is very important to specify your version, if you want a good answer. I cannot guess if it is C/AL or AL you are using.
Do not be afraid to crash the system, your properly will do this more than one time, but you will learn from this
Create a event subscriper from codeunit 12 OnBeforePostGenJnlLine .
Declare a local record of G/L Entry.
Thanks for reply
im using NAV 2018 and appreciate your code i will check it and get back to you,
Thanks to you
all i need to prevent the users to post an journal line with existing "External Document No." value in "G/L Entry".
Thanks your guidance was very helpful to me, i really appreciated