IRdsDictionaryInstance.CreateLookup

Syntax

CreateLookup([Attributes: String = ""]): IRdsDictionaryElementsLookup;

Parameters

Attributes. List of attributes, search is executed by attribute values. Names of attributes are separated by the sign ;. If this parameter is not defined, specify a list of attributes in the Attributes property.

Description

The CreateLookup method creates an object that searches MDM dictionary elements by specified attribute values.

Example

Executing the example requires the MDM repository NSI_1 that contains an MDM dictionary with the Dict_1 identifier.

Sub Main;

Var

MB: IMetabase;

Dict: IRdsDictionary;

DictInst: IRdsDictionaryInstance;

Look: IRdsDictionaryElementsLookup;

Element: IRdsDictionaryElement;

Begin

MB := MetabaseClass.Active;

Dict := MB.ItemByIdNamespace("DICT_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;

DictInst := Dict.Open(Null);

Look := DictInst.CreateLookup("NAME");

Look.Options := RdsElementsLookupOptions.Partial;

Look.Data.Value(0) := First;

For Each Element In Look.LookupList Do

Debug.WriteLine(Element.Name + " " + Element.Key.ToString);

End For;

End Sub Main;

After executing the example dictionary elements, that contain the word First in their name, are searched. If the search is successful, names and keys of found elements are displayed in the development environment console.

See also:

IRdsDictionaryInstance