RemoveByKey(AttributeKey: Integer): Boolean;
AttributeKey. Key of the attribute to be removed.
The RemoveByKey method removes the custom attribute, key of which is passed by the AttributeKey parameter.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
CalDim: ICalendarDimension;
UserAttrs: ICalendarDimAttributes;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("CALENDAR_DIM").Edit;
CalDim := MObj As ICalendarDimension;
UserAttrs := CalDim.Attributes;
If UserAttrs.FindByKey(14475) <> Null Then
UserAttrs.RemoveByKey(14475);
End If;
MObj.Save;
End Sub Main;
After executing the example a custom attribute with the 14475 key is removed from the calendar dictionary, if there is such an attribute.
See also: