Reference this Event on Contact.dal
[IntegrationEvent(TRUE, false)]
local procedure OnBeforeVendorInsert(var Vend: Record Vendor; var Contact: Record Contact)
begin
end;
I’m confused why this event includes the sender (Contact) when the Contact Record is passed as a parameter. The AL Tools appear to automatically add.
Goal: Change vendor No. based upon properties of the Contact. Why use one versus the other? Options: Vend.“No.” := Sender.“No.” OR Vendor.“No” := Contact.“No.”
AL tools auto-created this from the OnBeforeVendorInsert Event →
[EventSubscriber(ObjectType::Table, Database::Contact, 'OnBeforeVendorInsert', '', false, false)]
local procedure OnBeforeVendorInsert(var Sender: Record Contact; var Vend: Record Vendor; var Contact: Record Contact)
The method call in the Contact Table is:
OnBeforeVendorInsert(Vend, Rec);
Sender (Contact Record) and Rec (Contact Record) parameters appear to be identical in the subscriber.
Should a dev always include the Sender Parameter in the Subscriber, or would it be best to just use the below format since we don’t need “Sender”
ChangeVendorOnBeforeVendorInsert(var Vend: Record Vendor; var Contact: Record Contact)