I'm trying to un-apply a customer payment from two invoices but I'm getting the following error:
codeunit 60750 "Bugfix Unapply"
{
InherentPermissions = X;
Permissions = tabledata "Detailed Cust. Ledg. Entry" = RM,
tabledata "Detailed Vendor Ledg. Entry" = RM;
[EventSubscriber(ObjectType::Codeunit, 12, 'OnUnapplyVendLedgEntryOnBeforeSecondLook', '', false, false)]
local procedure BugfixPostingGroupVendorOnUnapplyBeforeSecondLook(NextDtldLedgEntryNo: Integer; var DtldVendLedgEntry2: Record "Detailed Vendor Ledg. Entry")
var
Vendor: Record Vendor;
begin
if DtldVendLedgEntry2.FindSet() then
repeat
Vendor.Get(DtldVendLedgEntry2."Vendor No.");
if DtldVendLedgEntry2."Posting Group" = '' then begin
DtldVendLedgEntry2."Posting Group" := Vendor."Vendor Posting Group";
DtldVendLedgEntry2.Modify();
end;
until DtldVendLedgEntry2.Next() = 0;
end;
[EventSubscriber(ObjectType::Codeunit, 12, 'OnOnUnapplyCustLedgEntryOnBeforeSecondLook', '', false, false)]
local procedure BugfixPostingGroupCustomerOnUnapplyBeforeSecondLook(NextDtldLedgEntryNo: Integer; var DtldCustLedgEntry2: Record "Detailed Cust. Ledg. Entry")
var
Customer: Record Customer;
begin
if DtldCustLedgEntry2.FindSet() then
repeat
Customer.Get(DtldCustLedgEntry2."Customer No.");
if DtldCustLedgEntry2."Posting Group" = '' then begin
DtldCustLedgEntry2."Posting Group" := Customer."Customer Posting Group";
DtldCustLedgEntry2.Modify();
end;
until DtldCustLedgEntry2.Next() = 0;
end;
}
André Arnaud de Cal... 291,642 Super User 2024 Season 2
Martin Dráb 230,371 Most Valuable Professional
nmaenpaa 101,156