microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
770 stars 610 forks source link

Table 'Invoice Post. Buffer' is marked for removal. #12687

Closed sankarvinop closed 2 years ago

sankarvinop commented 3 years ago

Hi, I am using this table 49 Invoice Post. Buffer in my extension which is published in app source. Now getting warning message as per below and its marked for removal.

Table 'Invoice Post. Buffer' is marked for removal. Reason: This table will be marked as temporary. Please ensure you do not store any data in the table.. Tag: 18.0.

Could you advice, What is the alternative for this table? any documentation available for this?

mrabus commented 3 years ago

Can you show us what you are doing with the table? (pseudo code is fine, too)

From my point of view, the table will still be usable in future releases but I will not allow to write to SQL anymore. Maybe it would be better to avoid the obsoletion.

sankarvinop commented 3 years ago

As part of localization, we keep details of VAT Entry. For example, if Sales or purchase order got two lines with Type as Item. Once its invoiced, In standard , it will be combined as one Entry in VAT Entry table, where as in our table, we keep track of individual entry and additional information which need to keep it VAT Entry table also.

Caption is changed from VAT to GST image

GST Entry --> VAT Entry GST Sale Entry --> Localization table This GST Sales Entry and GST Entry will be linked as-well.

image

Additional fields like , FULL GST Based Amount. if Particular Purchase Line is FULL Vat then, we need to capture what is Base amount for that. It has to go all the way from Invoice Post. Buffer to VAT Entry.

[EventSubscriber(ObjectType::Table, database::"Gen. Journal Line", 'OnAfterCopyGenJnlLineFromInvPostBuffer', '', false, false)] local procedure OnAfterCopyGenJnlLineFromInvPostBuffer(InvoicePostBuffer: Record "Invoice Post. Buffer"; VAR GenJournalLine: Record "Gen. Journal Line") begin GetGLSetup(); if not RecGLSetup.SGL_GSTReport_XXX then EXIT; GenJournalLine.Description := InvoicePostBuffer.SGL_PostDescr_XXX; GenJournalLine.SGL_FullGSTBaseSGD_UOB := InvoicePostBuffer.SGL_FullGSTBaseSGD_XXX GenJournalLine.SGL_PurcInvNo_UOB := InvoicePostBuffer.SGL_PurcInvNo_XXX; end;

For capturing detail entry below event and store it before its summarizing in standard by Items, or GL. in invoice posting buffer.

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnAfterFillInvoicePostBuffer', '', true, false)]

AlexanderYakunin commented 3 years ago

Current Invoice Post. Buffer should be temporary table, so obsolete statement added to remind you than this variable should be always used with 'temporary'.

Going forward we will replace this implementation with interface to let you switch to your own implementation of invoice posting (depending on regulatory and tax requirements). It will be possible without change of primary key (this is limitation for current implementation).

sankarvinop commented 3 years ago

We are using temporary only.
Noted on Interface method. Thanks.