IScheduledTaskProperties.UseDynamicMailList

Syntax

UseDynamicMailList: Boolean;

Description

The UseDynamicMailList property determines whether recipient list is created dynamically to send results of task completion.

Comments

Available values:

Example

Executing the example requires that the repository contains a scheduled tasks container with the TASK_CONTAINER identifier. Any task should be created in the container. A unit with the M_MAILLIST identifier should be also created in the repository, the unit implements the function to create the GetRecepients dynamical recipient list. The function has the following syntax:

GetRecepients syntax

Sub UserProc;
Var
    MB: IMetabase;
    Cont: IScheduledTasksContainer;
    Task: IScheduledTask;
    Props: IScheduledTaskProperties;
Begin
    MB := MetabaseClass.Active;
    Cont := MB.ItemById("TASK_CONTAINER").Bind As IScheduledTasksContainer;
    Task := Cont.Tasks.Item(0).Edit As IScheduledTask;
    Props := Task.Properties;
    //Dynamic recipient list
    Props.SendMail := True;
    Props.UseDynamicMailList := True;
    Props.DynamicMailListModule := MB.ItemById("M_MAILLIST");
    Props.DynamicMailListMacro := "GetRecepients";
    Props.MailTargetType := ScheduledTaskMailTarget.Personal Or ScheduledTaskMailTarget.Work;
    (Task As IMetabaseObject).Save;
End Sub UserProc;

On executing the example parameters of task completion notification will be changed for the first task in the scheduled task container: recipient list will be created dynamically using the specified macro.

See also:

IScheduledTaskProperties