IScheduledTaskProperties.UseDynamicMailList

Fore Syntax

UseDynamicMailList: Boolean;

Fore.NET Syntax

UseDynamicMailList: Boolean;

Description

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

Comments

Available values:

Fore 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.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example.

Imports Prognoz.Platform.Interop.KeFore;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Cont: IScheduledTasksContainer;
    Task: IScheduledTask;
    Props: IScheduledTaskProperties;
Begin
    MB := Params.Metabase;
    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.stmtPersonal Or ScheduledTaskMailTarget.stmtWork;
    (Task As IMetabaseObject).Save();
End Sub;

See also:

IScheduledTaskProperties