WeekLevel: ICalendarWeekLevel;
The WeekLevel property determines parameters of Weeks level in the calendar dictionary.
Sub Main;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
CalDim: ICalendarDimension;
WeekLev: ICalendarWeekLevel;
Begin
MB := MetabaseClass.Active;
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_CLNDIM;
CrInfo.Id := "CALENDAR_DIM";
CrInfo.Name := "Calendar dictionary";
CrInfo.Parent := MB.Root;
MObj := MB.CreateObject(CrInfo).Edit;
CalDim := MObj As ICalendarDimension;
CalDim.Hierarchy := 3;
CalDim.IncludeWeek := True;
CalDim.IncludeDays := True;
WeekLev := CalDim.WeekLevel;
WeekLev.FirstDayOfWeek := DayOfWeekSet.Sunday;
MObj.Save;
End Sub Main;
After executing the example a calendar dictionary with the CALENDAR_DIM identifier is created in repository root. Dictionary hierarchy contains Weeks and Days levels; the first day of the Weeks level is Sunday.
See also: