Update(Element: Integer; Data: IRdsDictionaryElementData);
Element - key of an element, which data should be updated.
Data - data that should be updated in element.
The Update method updates data of an element, which key is passed by the Element parameter.
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;
Attrs: IRdsAttributes;
DictInst: IRdsDictionaryInstance;
Elements: IRdsDictionaryElements;
Key: Integer;
Data: IRdsDictionaryElementData;
Begin
MB := MetabaseClass.Active;
Dict := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;
Attrs := Dict.Attributes;
DictInst := Dict.Open(Null);
Elements := DictInst.Elements;
Key := Elements.Item(1).Key;
Data := Elements.Data(Key);
Data.Value(Data.AttributeIndex(Attrs.Name.Key)) := New name;
Elements.Update(Key, Data);
End Sub Main;
After executing the example data of the first element of the MDM dictionary is updated.
See also: