[Event Request] Codeunit 31002 "SalesAdvLetterManagement CZZ" - procedure UnlinkAdvancePayment(var SalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ"; PostingDate: Date)
Describe the request
Hello,
I would like to ask for two new publishers in the codeunit 31002 "SalesAdvLetterManagement CZZ", procedure UnlinkAdvancePayment(var SalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ"; PostingDate: Date). Thank you.
procedure UnlinkAdvancePayment(var SalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ"; PostingDate: Date)
var
...
begin
...
SalesAdvLetterEntryCZZ2.SetRange("Entry Type", SalesAdvLetterEntryCZZ2."Entry Type"::"VAT Payment");
if SalesAdvLetterEntryCZZ2.FindSet() then begin
repeat
...
GenJnlPostLine.RunWithCheck(GenJournalLine);
until SalesAdvLetterEntryCZZ2.Next() = 0;
SalesAdvLetterEntryCZZ2.ModifyAll(Cancelled, true);
OnUnlinkAdvancePaymentOnAfterSalesAdvLetterEntryCZZ2CancelAll(SalesAdvLetterEntryCZZ2, SalesAdvLetterHeaderCZZ); // NEW EVENT
...
SalesAdvLetterEntryCZZ.Cancelled := true;
SalesAdvLetterEntryCZZ.Modify();
UpdateStatus(SalesAdvLetterHeaderCZZ, SalesAdvLetterHeaderCZZ.Status::"To Pay");
OnAfterUnlinkAdvancePayment(SalesAdvLetterEntryCZZ, SalesAdvLetterHeaderCZZ); // NEW EVENT
end;
// NEW EVENT
[IntegrationEvent(false, false)]
local procedure OnUnlinkAdvancePaymentOnAfterSalesAdvLetterEntryCZZ2CancelAll(var SalesAdvLetterEntryCZZ2: Record "Sales Adv. Letter Entry CZZ"; var SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ")
begin
end;
// NEW EVENT
[IntegrationEvent(false, false)]
local procedure OnAfterUnlinkAdvancePayment(var SalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ"; var SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ")
begin
end;
Additional context
We need to update our objects when the advance payment is unlinked. Internal work item: AB#523915
Hi,
For what BC version this is asked? I see that the code is different in the latest release than it is showed here.
Hello,
it was for the current version as of 27.3.2024, which was the version 23.5. In the current version 23.6 the code looks the same. But you are right that in the version 24.0 the code is different.
I checked the version 24.0, the code is moved to the another codeunit and little bit refactored. The good news are that there are already events available that we can use for our purposes.
So this requirement can probably be closed as we will soon update to the version 24.