IScheduledTaskCustomAlert.EventId

Syntax

EventId: String;

Description

The EventId property determines the event, on occurring of which the task is executed.

Comments

The event must be determined on the Custom Metadata > Events tab of the dialog of repository parameters setup.

Example

Executing the example requires:

Task settings must be determined on the Scheduletab :

Add links to the Metabase, Fore system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    cont: IScheduledTasksContainer;
    task: IScheduledTask;
    prop: IScheduledTaskProperties;
    alerts: IScheduledTaskAlerts;
    EventId: String;
    alert: IScheduledTaskAlert;
    CustomAlert: IScheduledTaskCustomAlert;
Begin
    MB := metabaseClass.Active;
    cont := MB.ItemById("TASK_CONTAINER").Edit As IScheduledTasksContainer;
    task := cont.Tasks.Item(0).Edit As IScheduledTask;
    prop := task.Properties;
    alerts := prop.Alerts;
    EventId := prop.EventId;
    EventId := "CUSTOM_EVENT";
    alert := alerts.Add(ScheduledTaskAlertType.Custom);
    CustomAlert := alert As IScheduledTaskCustomAlert;
    CustomAlert.EventId := EventId;
    (task As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the After Custom Event option of task execution frequency is set for the task, and the Start Download event is selected.

See also:

IScheduledTaskCustomAlert