Why do you need this change?
We need to add this event so that we can create the advance letter lines ourselves (we need to pre-fill some fields from the advance letter template).
Next, we need to move the global variable SalesAdvLetterHeaderCZZ to protected var.
Describe the request
Pleas add new event
local procedure CreateAdvancePostingBuffer(VATBusPostingGroup: Code[20]; VATProdPostingGroup: Code[20]; AmountIncludingVAT: Decimal; var TempAdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ" temporary)
var
//-------------------------------OnBeforeCreateBuffer:BEGIN
IsHandled: boolean;
//-------------------------------OnBeforeCreateBuffer:END
begin
//-------------------------------OnBeforeCreateBuffer:BEGIN
IsHandled := false;
OnBeforeCreateBuffer(VATBusPostingGroup, VATProdPostingGroup, AmountIncludingVAT, TempAdvancePostingBufferCZZ, IsHandled);
if IsHandled then
exit();
//-------------------------------OnBeforeCreateBuffer:END
TempAdvancePostingBufferCZZ.Init();
TempAdvancePostingBufferCZZ."VAT Bus. Posting Group" := VATBusPostingGroup;
TempAdvancePostingBufferCZZ."VAT Prod. Posting Group" := VATProdPostingGroup;
if TempAdvancePostingBufferCZZ.Find() then begin
TempAdvancePostingBufferCZZ.Amount += AmountIncludingVAT;
TempAdvancePostingBufferCZZ.Modify();
end else begin
TempAdvancePostingBufferCZZ.Amount := AmountIncludingVAT;
TempAdvancePostingBufferCZZ.Insert();
end;
end;
//-------------------------------OnBeforeCreateBuffer:BEGIN
[IntegrationEvent(false,true)]
local procedure OnBeforeCreateBuffer(VATBusPostingGroup: Code[20]; VATProdPostingGroup: Code[20]; AmountIncludingVAT: Decimal; var TempAdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ" temporary; var IsHandled: boolean)
//-------------------------------OnBeforeCreateBuffer:END
var
//-------------------------------SalesAdvLetterHeaderCZZ_Protected:BEGIN
//SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ";
//-------------------------------SalesAdvLetterHeaderCZZ_Protected:END
protected var
//-------------------------------SalesAdvLetterHeaderCZZ_Protected:BEGIN
SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ";
//-------------------------------SalesAdvLetterHeaderCZZ_Protected:END
Internal work item: AB#604893
Why do you need this change?
We need to add this event so that we can create the advance letter lines ourselves (we need to pre-fill some fields from the advance letter template).
Next, we need to move the global variable SalesAdvLetterHeaderCZZ to protected var.
Describe the request
Pleas add new event
Internal work item: AB#604893