Hello, I would like to transfer some customer columns from sale invoice to G/L entry. After posting sale invoice.
What EventSubscriber can I record on?
Hello, I would like to transfer some customer columns from sale invoice to G/L entry. After posting sale invoice.
What EventSubscriber can I record on?
To follow how BC transfer data from sales (or purchase) invoice (or credit memo), you must create the fields in “General Journal Line” not only in “G/L Entry”.
In the table “General Journal Line”, you must use the event OnAfterCopyGenJnlLineFromSalesHeader if the data is in the sales header, if it is in the lines, is a bit more complicated, you must add fields in “Invoice Posting Buffer” for new implementations or “Invoice Post. Buffer” for olders, use the events of this table to transfer data to general journal line and from sales line, but you must control that data is grouped correctly to not lost values.
In the table “G/L Entry”, you must use the event OnAfterCopyGLEntryFromGenJnlLine to transfer data from general journal line.
Thanks. I try this approach
Also consider using the new posting engine. As this contains events to allow you to change how the G/L is summarized. Something that could be customized in NAV, but we lost this ability with the original BC releases. Something the new posting engine brings back.
Hi Guys,
it’s works perfectly using
[EventSubscriber(ObjectType::Table, 17, ‘OnAfterCopyGLEntryFromGenJnlLine’, ‘’, false, false)]
[EventSubscriber(ObjectType::Table, 49, ‘OnAfterCopyToGenJnlLine’, ‘’, false, false)]
Thanks