Why do you need this change?
Hello This event publisher will use to set in record Purchase Credit Memo Header some fields. I review another codeunit for cancel posted sales credit memo. In this codeunit is exist such publisher
Describe the request
I paste the procedure of codeunit 1402 "Cancel Posted Purch. Cr. Memo". Between code I shall add the new lines which marked with comment "new line". In the end of codeunit must add new publisher OnBeforeTestCorrectCrMemoIsAllowed
procedure TestCorrectCrMemoIsAllowed(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.")
var //new line
IsHandled: Boolean; //new line
begin
IsHandled := false; //new line
OnBeforeTestCorrectCrMemoIsAllowed(PurchCrMemoHdr, IsHandled); //new line
if not IsHandled then begin //new line
TestIfPostingIsAllowed(PurchCrMemoHdr);
TestIfVendorIsBlocked(PurchCrMemoHdr, PurchCrMemoHdr."Buy-from Vendor No.");
TestIfVendorIsBlocked(PurchCrMemoHdr, PurchCrMemoHdr."Pay-to Vendor No.");
TestIfInvoiceIsCorrectedOnce(PurchCrMemoHdr);
TestIfCrMemoIsCorrectiveDoc(PurchCrMemoHdr);
TestVendorDimension(PurchCrMemoHdr, PurchCrMemoHdr."Pay-to Vendor No.");
TestDimensionOnHeader(PurchCrMemoHdr);
TestPurchLines(PurchCrMemoHdr);
TestIfAnyFreeNumberSeries(PurchCrMemoHdr);
TestExternalDocument(PurchCrMemoHdr);
TestInventoryPostingClosed(PurchCrMemoHdr);
end; //new line
OnAfterTestCorrectCrMemoIsAllowed(PurchCrMemoHdr);
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeTestCorrectCrMemoIsAllowed(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.; var IsHandled: Boolean)
begin
end;
Why do you need this change?
Hello This event publisher will use to set in record Purchase Credit Memo Header some fields. I review another codeunit for cancel posted sales credit memo. In this codeunit is exist such publisher
Describe the request
I paste the procedure of codeunit 1402 "Cancel Posted Purch. Cr. Memo". Between code I shall add the new lines which marked with comment "new line". In the end of codeunit must add new publisher OnBeforeTestCorrectCrMemoIsAllowed
procedure TestCorrectCrMemoIsAllowed(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.")
var //new line
IsHandled: Boolean; //new line
begin
IsHandled := false; //new line
OnBeforeTestCorrectCrMemoIsAllowed(PurchCrMemoHdr, IsHandled); //new line
if not IsHandled then begin //new line
TestIfPostingIsAllowed(PurchCrMemoHdr);
TestIfVendorIsBlocked(PurchCrMemoHdr, PurchCrMemoHdr."Buy-from Vendor No.");
TestIfVendorIsBlocked(PurchCrMemoHdr, PurchCrMemoHdr."Pay-to Vendor No.");
TestIfInvoiceIsCorrectedOnce(PurchCrMemoHdr);
TestIfCrMemoIsCorrectiveDoc(PurchCrMemoHdr);
TestVendorDimension(PurchCrMemoHdr, PurchCrMemoHdr."Pay-to Vendor No.");
TestDimensionOnHeader(PurchCrMemoHdr);
TestPurchLines(PurchCrMemoHdr);
TestIfAnyFreeNumberSeries(PurchCrMemoHdr);
TestExternalDocument(PurchCrMemoHdr);
TestInventoryPostingClosed(PurchCrMemoHdr);
end; //new line
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeTestCorrectCrMemoIsAllowed(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.; var IsHandled: Boolean)
begin
end;