Why do you need this change?
-
Procedure PostUnapply. In our custom extension code under if UnapplyVATEntries or (VATEntry."Unrealized VAT Entry No." <> 0) then begin should aways execute.
Example of custom code:
local procedure PostUnapply(GenJnlLine: Record "Gen. Journal Line"; var VATEntry: Record "VAT Entry"; VATEntryType: Enum "General Posting Type"; BilltoPaytoNo: Code[20]; TransactionNo: Integer; UnapplyVATEntries: Boolean; var TempVATEntry: Record "VAT Entry" temporary)
var
...
begin
...
if VATEntry.FindSet() then
repeat
VATPostingSetup.Get(VATEntry."VAT Bus. Posting Group", VATEntry."VAT Prod. Posting Group");
OnPostUnapplyOnBeforeUnapplyVATEntry(VATEntry, UnapplyVATEntries);
//if UnapplyVATEntries or (VATEntry."Unrealized VAT Entry No." <> 0) then begin //Custom commented code
InsertTempVATEntry(GenJnlLine, VATEntry, TempVATEntryNo, TempVATEntry);
if VATEntry."Unrealized VAT Entry No." <> 0 then begin
...
end;
Alternatives Evaluated:
We can use OnPostUnapplyOnBeforeUnapplyVATEntry to change values of UnapplyVATEntries or VATEntry."Unrealized VAT Entry No." and then code inside if UnapplyVATEntries or (VATEntry."Unrealized VAT Entry No." <> 0) statement will always execute, but we will need to return their origin values after that if check. For that we need additional event before procedure InsertTempVATEntry.
Describe the request
-
Procedure PostUnapply
local procedure PostUnapply(GenJnlLine: Record "Gen. Journal Line"; var VATEntry: Record "VAT Entry"; VATEntryType: Enum "General Posting Type"; BilltoPaytoNo: Code[20]; TransactionNo: Integer; UnapplyVATEntries: Boolean; var TempVATEntry: Record "VAT Entry" temporary)
var
...
begin
...
if VATEntry.FindSet() then
repeat
VATPostingSetup.Get(VATEntry."VAT Bus. Posting Group", VATEntry."VAT Prod. Posting Group");
OnPostUnapplyOnBeforeUnapplyVATEntry(VATEntry, UnapplyVATEntries);
if UnapplyVATEntries or (VATEntry."Unrealized VAT Entry No." <> 0) then begin
OnPostUnapplyOnBeforeInsertTempVATEntry(VATEntry, UnapplyVATEntries); //New event <---
InsertTempVATEntry(GenJnlLine, VATEntry, TempVATEntryNo, TempVATEntry);
if VATEntry."Unrealized VAT Entry No." <> 0 then begin
...
end;
[IntegrationEvent(false, false)]
local procedure OnPostUnapplyOnBeforeInsertTempVATEntry(var VATEntry: Record "VAT Entry"; var UnapplyVATEntry: Boolean)
begin
end;
Internal work item: AB#619462
Why do you need this change?
Procedure PostUnapply. In our custom extension code under if UnapplyVATEntries or (VATEntry."Unrealized VAT Entry No." <> 0) then begin should aways execute.
Example of custom code:
Alternatives Evaluated:
We can use OnPostUnapplyOnBeforeUnapplyVATEntry to change values of UnapplyVATEntries or VATEntry."Unrealized VAT Entry No." and then code inside if UnapplyVATEntries or (VATEntry."Unrealized VAT Entry No." <> 0) statement will always execute, but we will need to return their origin values after that if check. For that we need additional event before procedure InsertTempVATEntry.
Describe the request
Procedure PostUnapply
Internal work item: AB#619462