Sources: IRdsCompoundDictionarySources;
The Sources property returns a collection of dictionaries that are data sources for this composite MDM dictionary.
Executing the example requires the MDM repository NSI_1 that contains an MDM dictionary with the Dict_1 identifier.
Sub Main;
Var
MB: IMetabase;
NSI: IMetabaseObjectDescriptor;
CrInfo: IMetabaseObjectCreateInfo;
Dict: IRdsDictionary;
CompDict: IRdsCompoundDictionary;
CompSources: IRdsCompoundDictionarySources;
CompSource: IRdsCompoundDictionarySource;
Begin
MB := MetabaseClass.Active;
NSI := MB.ItemById("NSI_1");
Dict := MB.ItemByIdNamespace("Dict_1", NSI.Key).Bind As IRdsDictionary;
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_RDS_COMPDICTIONARY;
CrInfo.Id := "CompDict_1";
CrInfo.Name := Compound MDM dictionary;
CrInfo.Parent := NSI;
CompDict := MB.CreateObject(CrInfo).Edit As IRdsCompoundDictionary;
CompDict.CheckDublicates := True;
CompSources := CompDict.Sources;
CompSource := CompSources.Add;
CompSource.Id := "New_Source";
CompSource.Name := New source dictionary;
CompSource.Source := Dict;
(CompDict As IMetabaseObject).Save;
End Sub Main;
After executing the example a new composite MDM dictionary is created. One source dictionary is added into a composite dictionary. It is prohibited to add duplicates from sources into composite dictionary.
See also: