Check Value in External Document inside General Journal if its existing in GL Entry (posted) or Not

Suhail
Member Posts: 23
Dear guys,
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.
Best Regards,
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.
Best Regards,
0
Best Answer
-
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.5
Answers
-
What have you tryed so far? If you add your code + NAV/BC version, you can expend a lot better answer.For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.0
-
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 event0
-
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.5 -
by the way i find event similar to the requirement "CheckPurchExtDocNo" in Codeunit 12 and simlar to your code.
all i need to prevent the users to post an journal line with existing "External Document No." value in "G/L Entry".0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions