Issue in Event

navuser1navuser1 Member Posts: 1,329
edited 2019-12-16 in NAV Three Tier
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
Now or Never

Answers

  • navuser1navuser1 Member Posts: 1,329
    I think, the process creates a recursive & then generates the issue.
    Now or Never
  • navuser1navuser1 Member Posts: 1,329
    how to achieve the goal without modifying any base object ?
    Now or Never
  • PhoguePhogue Member Posts: 76
    edited 2019-12-17
    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:
    1. You call codeunit 22 to post an item journal line
    2. The event OnBeforePostItemJnlLine is raised
    3. Your eventsubscriber is called, and you post the line, before it is posted by the codeunit itself?
    4. The codeunit then tries to post the line, which is already posted
    5. You receive the message "There is nothing to post"
    6. If you could post a line several times, this would continue ad infinitum
  • navuser1navuser1 Member Posts: 1,329
    I've noticed the same already...now looking for the best possible solution without modifying any base code (if possible).
    Now or Never
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    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."
Sign In or Register to comment.