RemoveByKey(AttributeKey: Integer): Boolean;
AttributeKey — attribute key.
The RemoveByKey method removes attribute, key of which is passed by the AttributeKey parameter.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
UsDim: IUserDimension;
UsDimAts: IUserDimAttributes;
s: String;
Begin
MB:=MetabaseClass.Active;
MObj:=MB.ItemById("USER_DIM").Edit;
UsDim:=MObj As IUserDimension;
UsDimAts:=UsDim.Attributes;
If UsDimAts.RemoveByKey(5253) Then
s:="Removed";
Else
s:="It is not removed";
End If;
MObj.Save;
End Sub Main;
After executing the example the "s" variable contains Removed, if the last attribute of the calculated dictionary with the 5253 key is successfully removed. Calculated dictionary identifier: USER_DIM.
See also: