FindByKey(AttributeKey: Integer): ICustomDimOrder;
AttributeKey. Key of the attribute used for search.
The FindByKey method finds attribute in the collection by its key.
The method returns attribute parameters in case of successful search and Null, if the attribute is absent in sorting collection.
Sub Main;
Var
MB: IMetabase;
Cube: IStandardCube;
CustDim: ICustomDimension;
CustAtrs: ICustomDimAttributes;
CustDimOrd: ICustomDimOrders;
DimOrder: ICustomDimOrder;
s: String;
Begin
MB := MetabaseClass.Active;
Cube := MB.ItemById("CUBE_1").Bind As IStandardCube;
CustDim := Cube.FactDimension.Dimension As ICustomDimension;
CustAtrs := CustDim.Attributes;
CustDimOrd := CustAtrs.Orders;
DimOrder := CustDimOrd.FindByKey(CustAtrs.Name.Key);
If DimOrder <> Null Then
s := DimOrder.ReverseOrder.ToString;
Else
s := "Attribute does not fall into list of the sorting";
End If;
End Sub Main;
After executing the example the attribute with Name function is searched for in the sorting list; if the search is successful, the "s" variable contains direction of sorting by this attribute.
See also: