Clear;
The Clear method clears all non-unique keys of the MDM dictionary.
Use the IRdsNonUniqueKeys.Add method to add a new non-unique key of MDM dictionary.
Executing the example requires the MDM repository with the NSI_1 identifier that contains an MDM dictionary with the DICT_1 identifier.
Add links to the Metabase, Rds system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Dict: IRdsDictionary;
Attrs: IRdsAttributes;
Keys: IRdsNonUniqueKeys;
i: Integer;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Edit;
Dict := MObj As IRdsDictionary;
Attrs := Dict.Attributes;
Keys := Dict.NonUniqueKeys;
For i := 0 To Keys.Count - 1 do
Debug.WriteLine(Keys.Item(i).Name + " " + Keys.Item(i).Id);
End For;
Keys.Clear;
MObj.Save;
End Sub UserProc;
After executing the example the console window shows names and identifiers of non-unique keys, after which all non-unique keys of the MDM dictionary will be removed from the collection.
See also: