🌐 English · Français
A Manually event uses the Event Manager engine, but it’s run by an extension’s code, for example from an action. In SB Lawyer, the Alert PreInvoicing action of the matter list sends an email to the collaborators of the matters to invoice this way.
procedure SendMyManualEvent(MatterHeader: Record "SBX Matter Header")
var
EventManager: Record "SBX Event Manager";
EventMailPrint: Codeunit "SBX Dynamics Event Mail Print";
RecRef: RecordRef;
begin
EventManager.Get('MY-EVENT'); // manual event code
EventManager.TestField(Active, true);
EventManager.TestField("Event Type", EventManager."Event Type"::Manual);
RecRef.GetTable(MatterHeader);
EventMailPrint.SetMailSenders('to@example.com', '', ''); // recipients, optional
EventMailPrint.SendMail(EventManager, RecRef);
end;
The other actions are called the same way: SendUserTask and SendGlobalNotification (codeunit SBX Dynamics Event Mail Print), SendRequiredField and SendDuplicateRules (codeunit SBX Dynamics Fields Mgt.).
In User Restrictions, enter the users or security groups concerned: the event only fires for them.
Copy duplicates an existing event to create a similar one.