Move(IndexFrom: Integer; IndexTo: Integer);
IndexFrom - index of position from which the attribute is to be moved.
IndexTo - index of position to which the attribute is to be placed.
The Move method changes attributes' positions in sorting list thus changing priority of sorting by some attribute.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
UsDim: IUserDimension;
UsDimAtr: IUserDimAttributes;
DimOrd: IUserDimOrders;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("USER_DIM").Edit;
UsDim := MObj As IUserDimension;
UsDimAtr := UsDim.Attributes;
DimOrd := UsDimAtr.Orders;
DimOrd.Move(0, DimOrd.Count - 1);
MObj.Save;
End Sub Main;
After executing the example the first attribute in the sorting list is moved to the last position.
See also: