IRdsDictionaryElementsSearch.SelectSearchValue

Fore Syntax

SelectSearchValue: RdsSelectSearchValue;

Fore.NET Syntax

SelectSearchValue: Prognoz.Platform.Interop.Rds.RdsSelectSearchValue;

Description

The SelectSearchValue property determines condition of the search by value.

Comments

To get array of keys of all elements, which satisfy search conditions, use the IRdsDictionaryElementsSearch.FindAll method.

Fore Example

Executing the example requires that the repository contains an MDM table dictionary with the DIM identifier.

Add links to the Dimensions, Metabase, Orm and Rds system assemblies.

Sub UserProc;
Var
    DictInst: IRdsDictionaryInstance;
    Search: IRdsDictionaryElementsSearch;
    Cond: IOrmCondition;
Begin
    DictInst := MetabaseClass.Active.ItemById("DIM").Open(NullAs IRdsDictionaryInstance;
    DictInst.FetchAll := True;
    Search := DictInst.CreateSearch;
    // Set up search by value in the dictionary table
    Search.SelectSearchValue := RdsSelectSearchValue.Value;
    Cond := Search.Condition.Conditions.Add;
    // Choose attribute for search and set up search conditions
    Cond.AttributeName := DictInst.Attributes.Item(4).Id;
    Cond.Operator_ := OrmComparisonOperator.Equal;
    Cond.Value := 3
    // Display number of found elements
    Debug.WriteLine("Number of elements which are satisfactory to search conditions: " + 
        Search.FindAll.Count.ToString);
End Sub UserProc;

After executing the example search is executed by value in dictionary table. The console displays the number of found elements.

Fore.NET Example

The requirements and result of the Fore.NET Example execution match with those in the Fore Example.

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Orm;
Imports Prognoz.Platform.Interop.Rds;

Public Shared Sub Main(Params: StartParams);
Var
    DictInst: IRdsDictionaryInstance;
    Search: IRdsDictionaryElementsSearch;
    Cond: IOrmCondition;
Begin
    DictInst := Params.Metabase.ItemById["DIM"].Open(NullAs IRdsDictionaryInstance;
    DictInst.FetchAll := True;
    Search := DictInst.CreateSearch();
    // Set up search by value in the dictionary table
    Search.SelectSearchValue := RdsSelectSearchValue.rssvValue;
    Cond := Search.Condition.Conditions.Add();
    // Choose attribute for search and set up search conditions
    Cond.AttributeName := DictInst.Attributes.Item[4].Id;
    Cond.Operator := OrmComparisonOperator.ocoEqual;
    Cond.Value := 3
    // Display number of found elements
    System.Diagnostics.Debug.WriteLine("Number of elements that are satisfactory to search conditions: " + 
    Search.FindAll().Count.ToString());
End Sub;

See also:

IRdsDictionaryElementsSearch