Issue in Event

navuser1
Member Posts: 1,334
Dear Sir,
In NAV 2016, there is an Event function called OnBeforePostItemJnlLine in Codeunit 22 Item Jnl.-Post Line.
I am subscribing the same function in my custom codeunit & call the Codeunit 22 Item Jnl.-Post Line to Post something.
It's working with a message "There is nothing to Post" & it does not clear the Page.
What to do without modifying any base ? Please suggest.
Regards,
navuser1
In NAV 2016, there is an Event function called OnBeforePostItemJnlLine in Codeunit 22 Item Jnl.-Post Line.
I am subscribing the same function in my custom codeunit & call the Codeunit 22 Item Jnl.-Post Line to Post something.
It's working with a message "There is nothing to Post" & it does not clear the Page.
What to do without modifying any base ? Please suggest.
Regards,
navuser1
Now or Never
0
Answers
-
I think, the process creates a recursive & then generates the issue.Now or Never0
-
how to achieve the goal without modifying any base object ?
Now or Never0 -
What is your end-goal with this?
If you call codeunit 22 to post a line, on the OnBeforePost event of codeunit 22 for the same line, then:- You call codeunit 22 to post an item journal line
- The event OnBeforePostItemJnlLine is raised
- Your eventsubscriber is called, and you post the line, before it is posted by the codeunit itself?
- The codeunit then tries to post the line, which is already posted
- You receive the message "There is nothing to post"
- If you could post a line several times, this would continue ad infinitum
0 -
I've noticed the same already...now looking for the best possible solution without modifying any base code (if possible).Now or Never0
-
Do you need to have it posted before the actual standard posting starts? If not, I would rather tried to add the line(s) you want to post to the list of lines the standard procedure will post, and let standard post it."Money is likewise the greatest chance and the greatest scourge of mankind."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