Dear All,
Hi, I am subscribing an event to a custom table. But I am not getting my required result. I need a message when
OnAfterValidateEvent runs. It's not firing even a simple message. Below is my sample code.
EventSubscriberInstance = StaticAutomatic;
[EventSubscriber(ObjectType::Table, Database::"Payment Document Line", 'OnAfterValidateEvent', 'Applies-to Doc. Type', true, true)]
local procedure OnAfterValidateEvent(VAR Rec: Record "Payment Document Line")
var
PurInvLine: Record "Purch. Inv. Line";
Begin
CASE Rec."Account Type" OF
Rec."Account Type"::Vendor:
BEGIN
If Rec."Document Type" = Rec."Document Type"::Invoice then Begin
Message('yes its an invoice');
End
End;
Rec."Account Type"::"Bank Account":
Exit;
Rec."Account Type"::"G/L Account":
Exit;
Rec."Account Type"::Customer:
Exit;
Rec."Account Type"::Employee:
Exit;
Rec."Account Type"::"Fixed Asset":
Exit;
Rec."Account Type"::"IC Partner":
Exit;
End
End;