Cicode Programming Reference > Cicode Function Categories > Scheduler Functions > ScheduleItemSetRepeat

ScheduleItemSetRepeat

The ScheduleItemSetRepeat function adds recurrence information to an existing schedule to the scheduler engine. The same function is used if the schedule already has recurrence information that need to be changed.

This function is a blocking function. It blocks the calling Cicode task until the operation is complete.

Syntax

LONG ScheduleItemSetRepeat(STRING Cluster, LONG ID, LONG Freq, LONG Interval, LONG Weekday, LONG WeekDayMask, LONG MaxRec, LONG RecUntil,LONG DayOrd, LONG Day, LONG Month,LONG SpecialInc, STRING GroupIds)

Cluster

Name of cluster

ID

The existing schedule id to apply recurrence.

Freq:

The type of the recurrence: 4 – daily, 5 – weekly, 6- monthly, 7 – yearly, 8 – special days.

Interval:

The interval of the recurrence. 1 – every 1 day/week/month etc., 2 – every second and so on.

WeekDay:

The first day of week – Sunday (0) or Monday (1)

WeekDayMask:

The day of week mask. Defines day of week where recurrence happens.

None = 0,

Sunday = 1,

Monday = 2,

Tuesday = 4,

Wednesday = 8,

Thursday = 16,

Friday = 32,

Saturday = 64,

Everyday = 127,

Weekdays = 62,

Weekenddays = 65

Combination of days can be achieved by addition. For example, Tuesdays and Wednesdays would be 12 (4 + 8).

MaxRec:

The maximum number recurrences (-1 means does not stop)

RecUntil:

The time specifies the time until recurrence is occurring. The type of this parameter is TIMESTAMP. Use TimestampCreate or StrToTimestamp to get a TIMESTAMP value. To create a recurring schedule that does not end use TimestampCreate(1601, 1, 1, 0, 0, 0, 0, 1)

DayOrd:

Day ordinal. Applicable for monthly and yearly recurrence patterns. Can be 1-4 or -1 (every 1, second, third, fourth or last week of a month).

Day:

The day of month

Month:

The month of the year

SpecialInc:

Defined whether the special day is included in the pattern. 0 – none, 1 – every, 2 – selected.

GroupIds :

A list of group’s ID included in the recurring pattern (used only when SpecialIncl is defined as 2 ("selected")).

 

Return Value

Returns 0 if successful otherwise it returns an error.

Related Functions

SchdConfigOpen,SchdConfigClose, SchdConfigFirst,SchdConfigNext,SchdConfigPrev, SchdConfigGetField, SchdConfigNumRecords,SchdOpen, SchdClose, SchdFirst,SchdNext,SchdGetField, SchdNumRecords, ScheduleItemAdd, ScheduleItemModify, ScheduleItemDelete

See Also

Scheduler Functions

Published June 2018