SimpleProbe: IDimSimpleAttrProbe;
The SimpleProbe property determines an object that helps test attributes, by values of which the search should be carried out.
This property is used to search elements in any dictionary or MDM dictionary. It is necessary to select a user class object, that implements methods of the IDimSimpleAttrProbe interface, as the value of this property.
NOTE. As a value of this property the object can be used which is returned by the property IRdsAttributesList.Probe.
Executing the example requires a form, a button named Button1 on the form, the RdsDictionaryBox component named RdsDictionaryBox1 and the UiRdsDictionary component that is a data source for RdsDictionaryBox1. The MDM dictionary linked to the UiRdsDictionary component contains Name and UserAttr attributes.
Sub Button10OnClick(Sender: Object; Args: IMouseEventArgs);
Var
RdsInst: IRdsDictionaryInstance;
Search: IRdsDictionaryElementsSearch;
AttrsList: IRdsAttributesList;
Crit: IDimTextCriteria;
Keys: IRdsDictionaryElementArray;
Begin
RdsInst := RdsDictionaryBox1.Source.Instance;
Search := RdsInst.CreateSearch;
AttrsList := Search.Attributes;
//Hint attributes in collection
AttrsList.Attributes := "Name;Key";
Crit := New DimTextCriteria.Create;
//Define attributes using Probe method
Crit.CriteriaOptions := TextCriteriaOptions.SearchProbeAttributes
Or TextCriteriaOptions.FreeText;
//Indicate object that determines attributes for search
//For attributes Name and Key method returns value True as they are included to collection
Crit.SimpleProbe := AttrsList.Probe;
Crit.Text := "401";
Search.SetTextCriteria(Crit);
Keys := Search.FindAll;
End Sub Button10OnClick;
After executing the example clicking the button creates an object for finding MDM dictionary elements. Search condition is selected. Attributes by values of which the search should be performed are defined using the Probe method. As the testing object the method uses system object based on the attribute collection stored in the AttrsList variable. After search the Keys variable contains the array of found elements keys.
See also: