IScheduledTask.ResetResults

Syntax

ResetResults;

Description

The ResetResults method clears task execution history and set it to the Ready state.

Comments

To get task execution history, use the IScheduledTask.GetResults method.

Example

Executing the example requires that the repository has a scheduled tasks container with the SCHEDULEDTASKSCONTAINER identifier.

Add links to the Fore, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Cont: IScheduledTasksContainer;
    Tasks: IMetabaseObjectDescriptors;
    Task: IScheduledTask;
    Results: IScheduledTaskResults;
    Result: IScheduledTaskResult;
    i: Integer;
Begin
    
// Get current repository
    MB := MetabaseClass.Active;
    
// Get a container of scheduled tasks
    Cont := MB.ItemById("SCHEDULEDTASKSCONTAINER").Bind As IScheduledTasksContainer;
    
// Get the first task
    Tasks := Cont.Tasks;
    Task := Tasks.Item(
0).Edit As IScheduledTask;
    
// Clear task execution history
    Task.ResetResults;
    
// Save changes
    (Task As IMetabaseObject).Save;
End Sub UserProc;

After executing the example, the first task execution history will be reset, the task will be set to the Ready state.

See also:

IScheduledTask