IRdsExportSchemas.Add

Syntax

Add: IRdsExportSchema;

Description

The Add method creates a new export scheme.

Example

Executing the example requires the MDM repository NSI_1 that contains an MDM dictionary with the Dict_1 identifier. The database set for the MDM repository contains the TabExport table that includes fields with names as names of basic attributes of a dictionary.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    Dict: IRdsDictionary;
    Export: IRdsExportSchemas;
    SchemaExport: IRdsExportSchema;
    Attrs: IRdsAttributes;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Edit;
    Dict := MObj As IRdsDictionary;
    Attrs := Dict.Attributes;
    Export := Dict.ExportSchemas;
    SchemaExport := Export.Add;
    SchemaExport.Id := "Export1";
    SchemaExport.Name := Export scheme #1;
    SchemaExport.Mappings(Attrs.Key).FieldName := "Key";
    SchemaExport.Mappings(Attrs.Name).FieldName := "Name";
    SchemaExport.Mappings(Attrs.Order).FieldName := "Ord";
    SchemaExport.Mappings(Attrs.ParentKey).FieldName := "Parent_key";
    SchemaExport.TableName := "TabExport";
    MObj.Save;
End Sub UserProc;

After executing the example a new export scheme is created in the MDM dictionary. Attribute values of a dictionary are exported in same-name fields of the TabExport table.

See also:

IRdsExportSchemas