LookUpLevel(IndexAttributesValues: Variant; Level: Integer): Integer;
IndexAttributesValues. Values of attributes on which search is carried out.
Level. Level at which search is carried out.
The LookUpLevel method searches element in specified dictionary level.
The method returns "-1": if element with search value is not found.
If the Level parameter is set to "-1", the search is carried out whatever the level is.
Executing the example requires that repository contains table dictionary with the DIM_SEP identifier which consists of two levels.
Add links to the Dimensions, Metabase system assemblies.
Sub UserProc;
Var
mb: IMetabase;
dimension: IDimensionModel;
instance: IDimInstance;
levels: IDimLevels;
level: IDimLevel;
attrs: IDimAttributes;
attr: IDimAttribute;
indexesinstance: IDimIndexesInstance;
indexinstance: IDimIndexInstance;
arr: array Of Variant;
i, n: integer;
Begin
// Get repository
mb := MetabaseClass.Active;
// Get access to dictionary data
instance := mb.ItemById("DIM_SEP").Open(Null) As IDimInstance;
// Create array for search
Arr := New Variant[1];
// Get collection of dictionary indexes
indexesinstance := instance.Indexes;
// Get the first dictionary index
indexinstance := indexesinstance.Item(0);
// Search the "1000" element
Arr[0] := 1000;
// Get element sequence number
i := indexinstance.LookUpLevel(Arr, 1);
// Display to the console order number
Debug.WriteLine("Sequence number of found element = " + i.ToString);
End Sub UserProc;
After executing the example the console displays order number of dictionary search element.
See also: