IScheduledEvent.StartDateTime

Syntax

StartDateTime: DateTime;

Description

The StartDateTime property returns date and time, at which the event launching was scheduled.

Example

Executing the example requires that the repository contains a scheduled tasks container with the TASK_CONTAINTER identifier.

Sub Main;

Var

MB: IMetabase;

Cont: IScheduledTasksContainer;

Tasks: IMetabaseObjectDescriptors;

Invoke: IScheduledInvoke;

Events: IScheduledEvents;

TaskEvent: IScheduledEvent;

i: Integer;

Begin

MB := MetabaseClass.Active;

Cont := MB.ItemById("TASK_CONTAINTER").Bind As IScheduledTasksContainer;

Tasks := Cont.Tasks;

Invoke := Cont.CreateInvokeEvent(DateTime.Now);

Events := (Invoke As IScheduledEvents);

For i := 0 To Events.Count - 1 Do

TaskEvent := Events.Item(i);

Debug.WriteLine(TaskEvent.StartDateTime.ToString + " " + Tasks.FindByKey(TaskEvent.TaskKey).Name);

End For;

End Sub Main;

After executing the example the list of events execution of which is scheduled in the scheduled tasks container is displayed in the development environment console. The time of event execution start and name of executing task are displayed.

See also:

IScheduledEvent