ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Design issue(s): Allow custom posting routines of G/L Journal Lines

Open hemisphera opened this issue 8 years ago • 1 comments

This issue actually goes hand-in-hand with my other event-requests (#2526, #2473). Maybe it's time I elaborate:

What I am trying to achieve is allowing certain Gen. Journal Lines to be posted with custom routines. There are scenarios (hooray for Italy) where we need special treatment for certain lines and don't want them to finish in the general ledger (statiscs, trial balance, reports, accruals, you name it). So while I'd like to keep the posting (Journals, Chart of Accounts) infrastructure intact, I just need my entries to finish elsewhere.

I have already requested a few events to allow me to implement my posting routine (see above), but there is a fundamental flaw in that design:

  1. When posting a general journal, NAV looks at "No." of the last G/L Register before posting and expects the "No." of the last G/L Register after posting to be + 1
  2. I do understand the safety-measure, but when I implement a custom posting routing via events, I am having a hard time getting the registers to be contiguous, because they are managed as a global variable in the codeunit. I found a workaround, but I don't like it that much.
  3. When this is not the case - maybe I don't even WANT to create a G/L Register? Maybe I end up with two registers in one posting-batch? Then the posting fails with an message "There is nothing to post". But that is not be the case at all, because infact, I have posted.

I think some parts (mostly the global-variable-thingy) in CU12 / CU13 could do with a little workover to allow us to efficiently implement custom posting routines through events / extensions.

Happy to elaborate, should you need more info.

hemisphera avatar Jun 08 '18 13:06 hemisphera

Hi,

These are not scenarios we want to support at this time. I would suggest you look at the problem differently and instead of meddling with Codeunit 12 to post your special lines, you replace the posting action(s) so your codeunit is called first where you process your special lines, and then call codeunit 12 only on those lines that require standard posting.

br/Gert

grobyns avatar Dec 20 '18 11:12 grobyns