Executing the example requires that the repository contains a scheduled tasks container with the NewSTCont identifier.
Sub Main;
Var
MB: IMetabase;
Cont: IScheduledTasksContainer;
Tasks: IMetabaseObjectDescriptors;
Task: IScheduledTask;
Invoke: IScheduledInvoke;
i: Integer;
Begin
MB := MetabaseClass.Active;
Cont := MB.ItemById("NewSTCont").Bind As IScheduledTasksContainer;
Tasks := Cont.Tasks;
Task := Tasks.Item(0).Bind As IScheduledTask;
Invoke := Task.CreateInvokeEvent(DateTime.Now);
Invoke.Invoke(MB);
End Sub Main;
After executing the example the execution event of the first task in the scheduled tasks container is created. This event will be executed. A record taking into account the current date and time will be added to the history.
See also: