ICalendarDimAttributes.FindByKey

Syntax

FindByKey(AttributeKey: Integer): ICalendarDimAttribute;

Parameters

AttributeKey. Key of the attribute on which the search is based.

Description

The FindByKey method searches the custom attribute, key of which is passed in the AttributeKey parameter.

Example

Sub UserProc;
Var
    MB: IMetabase;
    CalDim: ICalendarDimension;
    UserAttrs: ICalendarDimAttributes;
    UserAttr: ICalendarDimAttribute;
    s: String;
Begin
    MB := MetabaseClass.Active;
    CalDim := MB.ItemById("CALENDAR_DIM").Bind As ICalendarDimension;
    UserAttrs := CalDim.Attributes;
    UserAttr := UserAttrs.FindByKey(14475);
    If UserAttr <> Null Then
        s := UserAttr.Name;
    Else
        s := "Attribute not found";
    End If;
End Sub UserProc;

After executing the example a custom attribute with the 14475 key is searched, and if the element is found, the "s" variable contains its name.

See also:

ICalendarDimAttributes