Events are key points within a Business Central process that can be used to trigger alerts. They’re linked to an Alert table.

Custom Events are used in place where standard triggers (i.e. Table Changes) aren’t detailed enough for a specific business scenario. They’re a specific string, i.e. GLPOST which is used by Alerts and the Code.

You can see a list of included events here.

You can create custom events by integrating with Alerts via your own AL extension/app (see Development in AL).

Integrating with Alerts via an extension

  1. Add a dependency to the Alerts app in your AL project. Make sure to use up-to-date values from extension management in Business Central.
  2. Call the ScheduleEventAlert function from codeunit FSG_ALT_AlertEventListener where you want the alert to trigger. You will need to provide the following parameters:
RecRefThe RecordRef of the record the event is being called upon.
xRecRefThe RecordRef of the record before any changes have been made.
EventCodeSpecifies a unique code to identify this type of event.
IsDeleteSpecifies if the record has/will be deleted within the current code execution.

Creating and using a custom event

  1. Locate and open the Alert Tables page.
  2. Create or highlight an alert table appropriate for the event and then select Events.
  3. Create a new alert event.
  4. Create a new Alert (see Creating a new Alert), specify the trigger as event, and the table and event code from step 1 & 2.

Alert Event FieldExplanation
CodeSpecifies a unique code to identify this type of event.
DescriptionSpecifies a description for the event.