Add(Value: IUserDimAttribute);
Value - attribute that must be added to index.
The Add method adds the attribute that is passed by the Value parameter to the index.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
UsDim: IUserDimension;
UsDimInds: IUserDimIndexes;
UsDimIndex: IUserDimIndex;
IndexAtr: IUserDimIndexAttributes;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("USER_DIM").Edit;
UsDim := MObj As IUserDimension;
UsDimInds := UsDim.Indexes;
If UsDimInds.Count <> 0 Then
UsDimIndex := UsDimInds.Item(0);
IndexAtr := UsDimIndex.Attributes;
If IndexAtr.FindByKey(UsDim.Attributes.Order.Key) = Null Then
IndexAtr.Add(UsDim.Attributes.Order);
End If;
End If;
MObj.Save;
End Sub Main;
After executing the example the attribute functioning as Order is added to the first index of the dictionary. Calculated dictionary identifier: USER_DIM.
See also: