Lookup: IRdsDictionaryElementArray;
The Lookup method searches and returns an array that contains element keys that meet search conditions.
Executing the example requires the MDM repository NSI_1 that contains an MDM dictionary with the Dict_1 identifier.The dictionary has an additional attribute with the ATTRIBUTE1 identifier.
Sub Main;
Var
MB: IMetabase;
Dict: IRdsDictionary;
DictInst: IRdsDictionaryInstance;
Look: IRdsDictionaryElementsLookup;
Element: Integer;
Elements: IRdsDictionaryElements;
Begin
MB := MetabaseClass.Active;
Dict := MB.ItemByIdNamespace("DICT_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;
DictInst := Dict.Open(Null);
Elements := DictInst.Elements;
Look := DictInst.CreateLookup("NAME;ATTRIBUTE1");
Look.Options := RdsElementsLookupOptions.Partial Or RdsElementsLookupOptions.CaseInsensitive;
Look.Data.Value(0) := First;
Look.Data.Value(1) := 100;
For Each Element In Look.Lookup Do
Elements.Delete(Element);
End For;
End Sub Main;
After executing the example MDM dictionary elements are searched by values of two attributes. Elements that have the word First in their name and number 100 in additional attribute values are searched. Found elements are removed from a dictionary.
See also: