EvaluateRec(Value: IOrmRecord): Boolean;
Value. The collection of attribute values implemented by the IOrmRecord interface that should be tested.
The EvaluateRec method tests attribute values and determines whether they meet the search conditions.
This method is used to evaluate MDM dictionaries' elements. You can get attribute value implemented by the interface using the property IRdsDictionaryElementData.Record.
Executing the example requires a form, a button named Button1 positioned on this form, the RdsDictionaryBox component named RdsDictionaryBox1 and the UiRdsDictionary component used as a data source for RdsDictionaryBox1. The MDM dictionary linked to the UiRdsDictionary component, contains the Name and UserAttr attributes.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
RdsInst: IRdsDictionaryInstance;
Search: IRdsDictionaryElementsSearch;
Cond: IDimOrmCondition;
Crit: IDimTextCriteria;
Elems: IRdsDictionaryElements;
Elem: IRdsDictionaryElement;
i: Integer;
Begin
RdsInst := RdsDictionaryBox1.Source.Instance;
Search := RdsInst.CreateSearch;
Search.Attributes.Attributes := "Name;UserAttr";
Crit := New DimTextCriteria.Create;
Crit.CriteriaOptions := TextCriteriaOptions.SearchStringAttributes
Or TextCriteriaOptions.FreeText;
Crit.Text := "Population income";
Cond := Search.Condition;
Cond.SetTextCriteria(Crit);
Elems := RdsInst.Elements;
For i := 0 To Elems.Count - 1 Do
Elem := Elems.Item(i);
Debug.WriteLine(Elem.Name + ": Satisfies search conditions - " +
Cond.EvaluateRec(Elem.Record).ToString);
End For;
End Sub Button1OnClick;
After executing the example clicking the button creates an object for finding MDM dictionary elements. 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: