IRdsDictionaryElementsSearch.Condition

Syntax

Condition: IDimOrmCondition;

Description

The Condition property returns the collection of search conditions.

Example

Executing the example requires a form with the Button1 button, the RdsDictionaryBox component named RdsDictionaryBox1, and the UiRdsDictionary component that is a data source for RdsDictionaryBox1. The MDM dictionary that is connected to the UiRdsDictionary component has the attributes Name and UserAttr.

    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 := Income of the population;
        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 + : It meets search conditions -  +
                Cond.EvaluateRec(Elem.Record).ToString);
        End For;
    End Sub Button1OnClick;

After executing the example, pressing the button creates an object for searching MDM dictionary elements. The condition, according to which search should be executed, is set. Then all elements are checked against search conditions. Names of elements and result of check are displayed in the development environment console.

See also:

IRdsDictionaryElementsSearch