CustomWhere: IOrmConditions;
The CustomWhere property returns additional conditions of the hierarchy.
Executing the example requires that the repository contains a time series database with the OBJ_FC identifier.The database must contain a mandatory attribute with the COUNTRY identifier. Add links to the Metabase, Rds, Cubes, Orm system assemblies.
Sub UserProc;
Var
Mb: Imetabase;
Rubr: IMetabaseObject;
RubrInst: IRubricatorInstance;
Facts: IMetaDictionaryInstance;
Hierarchy: IMetaHierarchy;
HInstance: IMetaHierarchyInstance;
Mem: IMetaMember;
Conds: IOrmConditions;
con: IOrmCondition;
Mems: IMetaMembers;
Begin
Mb := MetabaseClass.Active;
Rubr := MB.ItemById("OBJ_FC").Bind;
RubrInst := Rubr.Open(Null) As IRubricatorInstance;
Facts := RubrInst.GetDictionary(RubricatorDictionary.Facts);
Hierarchy := Facts.Dictionary.DefaultHierarchy;
HInstance := Facts.OpenHierarchy(Hierarchy);
Mems := HInstance.GetRootMembers;
Mem := Mems.Current;
Debug.WriteLine(Before);
Debug.WriteLine(Mem.CountTotal);
Conds := HInstance.CustomWhere;
con := Conds.Add;
con.AttributeName := "COUNTRY";
con.Value := 512;
HInstance.Build;
Mems := HInstance.GetRootMembers;
Mem := Mems.Current;
Debug.WriteLine(After);
Debug.WriteLine(Mem.CountTotal);
End Sub UserProc;
After executing the example information about number of elements in the hierarchy before and after additional condition applying is displayed in the console window.
See also: