IRdsCompoundDictionarySources.Add

Syntax

Add: IRdsCompoundDictionarySource;

Description

The Add method creates a data source.

Example

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.

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;

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.

See also:

IRdsCompoundDictionarySources