mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 09:26:52 +01:00
26 lines
784 B
AL
26 lines
784 B
AL
codeunit 50151 "Sec Sample CommitBeh Bad"
|
|
{
|
|
[IntegrationEvent(true, false)]
|
|
procedure OnBeforeApplyingDiscount(var Customer: Record Customer)
|
|
begin
|
|
end;
|
|
|
|
procedure ApplyDiscount(var Customer: Record Customer)
|
|
begin
|
|
Customer."Customer Price Group" := 'VIP';
|
|
Customer.Modify(true);
|
|
OnBeforeApplyingDiscount(Customer);
|
|
if Customer."Credit Limit (LCY)" <= 0 then
|
|
Error('Customer %1 not eligible', Customer."No.");
|
|
Commit();
|
|
end;
|
|
}
|
|
|
|
codeunit 50152 "Sec Sample CommitBeh Bad Sub"
|
|
{
|
|
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sec Sample CommitBeh Bad", 'OnBeforeApplyingDiscount', '', true, true)]
|
|
local procedure NotifyOther(var Customer: Record Customer)
|
|
begin
|
|
Commit();
|
|
end;
|
|
}
|