ICalendarDimAttributes.Add

Syntax

Add: ICalendarDimAttribute;

Description

The Add method creates a new custom attribute.

Example

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

CalDim: ICalendarDimension;

UserAttrs: ICalendarDimAttributes;

UserAttr: ICalendarDimAttribute;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemById("CALENDAR_DIM").Edit;

CalDim := MObj As ICalendarDimension;

UserAttrs := CalDim.Attributes;

UserAttr := UserAttrs.Add;

UserAttr.Expression(-1).AsString := #34 + "Level element " + #34 + "+LEVEL";

UserAttrs.Name := UserAttr;

MObj.Save;

End Sub Main;

After executing the example a new custom attribute is added to calendar dictionary, and the same expression is set for elements of all levels. On creating the dictionary element names will be based on this attribute.

See also:

ICalendarDimAttributes