Mappings(Attribute: IRdsAttribute): IRdsAttribute;
Attribute - custom attribute of a composite dictionary, for which it is necessary to set binding.
The Mappings property determines binding of an attribute of a composite dictionary to an attribute of source dictionary.
Executing the example requires the MDM repository NSI_1. This repository contains two dictionaries: 1) a standard dictionary with the Dict_1 identifier; 2) a composite MDM dictionary with the CompDict_1 identifier. Each dictionary contains an additional attribute with the ATTRIBUTE identifier.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Dict: IRdsDictionary;
CompDict: IRdsCompoundDictionary;
CompSources: IRdsCompoundDictionarySources;
CompSource: IRdsCompoundDictionarySource;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("CompDict_1", MB.ItemById("NSI_1").Key).Edit;
Dict := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;
CompDict := MObj As IRdsCompoundDictionary;
CompSources := CompDict.Sources;
CompSource := CompSources.Add;
CompSource.Id := "New_Source";
CompSource.Name := New source dictionary;
CompSource.Source := Dict;
CompSource.Mappings(CompDict.Attributes.FindById("ATTRIBUTE")) := Dict.Attributes.FindById("ATTRIBUTE");
MObj.Save;
End Sub Main;
After executing the example a new source is added into a composite dictionary. The MDM dictionary Dict_1 is data source. An additional attribute of a composite dictionary is linked to the similar attribute in the MDM dictionary.
See also: