CreateSimpleClass(Dimension: ): IDimOrmClass;
Dimension. Dictionary implemented by the interface IOrmSimpleClass. Dictionary structure or MDM dictionary structure can be passed as parameter value.
The CreateSimpleClass method creates an object used to work with conditions of element search in dictionaries and MDM dictionaries.
Executing the example requires an MDM repository with the MDM identifier. This repository contains an MDM dictionary with the Dict_1 identifier.
Sub UserProc;
Var
MB: IMetabase;
RdsDict: IRdsDictionary;
RdsDictInst: IRdsDictionaryInstance;
OrmMan: IDimOrmManager;
OrmClass: IDimOrmClass;
Condition: IDimOrmCondition;
Crit: IDimTextCriteria;
Elems: IRdsDictionaryElements;
Elem: IRdsDictionaryElement;
i: Integer;
Begin
MB := MetabaseClass.Active;
RdsDict := MB.ItemByIdNamespace("Dict_1", MB.ItemById("RDS").Key).Bind As IRdsDictionary;
RdsDictInst := RdsDict.Open(Null);
OrmMan := New DimOrmManager.Create;
OrmClass := OrmMan.CreateSimpleClass(RdsDict As IOrmSimpleClass);
Condition := OrmClass.CreateCondition;
Crit := New DimTextCriteria.Create;
Crit.CriteriaOptions := TextCriteriaOptions.SearchStringAttributes Or TextCriteriaOptions.FreeText;
Crit.Text := "Data";
Condition.SetTextCriteria(Crit);
Elems := RdsDictInst.Elements;
For i := 0 To Elems.Count - 1 Do
Elem := Elems.Item(i);
Debug.WriteLine(Elem.Name + ": Satisfies search conditions - " +
Condition.EvaluateRec(Elem.Record).ToString);
End For;
End Sub UserProc;
Executing the example creates an object used to work with search conditions in selected dictionary. Element search condition is selected. Next, all elements are checked for meeting the search conditions. Element names and checking results are displayed in development environment console.
See also: