Codeunit 5802 - Inventory Posting To G/L - OnAfterBufferConsumpPosting - PostBufDimNo parameter passed by reference
Hello,
Firstly, I would like to thank you for adding OnAfterBufferConsumpPosting event that I asked for in this issue. Unfortunately, an important part of my request was not implemented:
This event is similar to OnAfterBufferSalesPosting() event in BufferSalesPosting() procedure, but please take notice of PostBufDimNo parameter being passed by reference. This is due to our requirement to post 2 additional G/L Entries, which means that we need to create 4 buffer entries in total and update PostBufDimNo accordingly.
Our legislation requires us to post not 2 but 4 G/L Entries when posting consumption. In NAV 2018, we implemented this by several changes to base application:
- extending InventoryPostingBuffer.AccountType option with 2 new values
- increasing TempInvtPostBuf record array size to 6
- additional code in BufferInvtPosting(), BufferConsumpPosting(), SetAccNo(), UpdateValueEntry() ...
In BC (SaaS), these changes are of course impossible, so we designed a solution that only requires the event above. Our subscriber function takes inventory posting buffer with two consumption lines and generates two additional buffer lines. At this point, it must be possible to increase PostBufDimNo from 2 to 4 and pass increased value back to publisher. Otherwise, posting procedure that follows ignores additional lines and only posts 2 lines originally created, disabling our solution.
I hope I sufficently explained our request. If not, I am available for further clarification.
Best regards, Matjaz
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.