IRdsAttributes.Add

Syntax

Add: IRdsAttribute;

Description

The Add method creates a custom attribute.

Example

Executing the example requires the MDM repository NSI_1 that contains an MDM dictionary with the Dict_1 identifier.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

Dict: IRdsDictionary;

Attrs: IRdsAttributes;

Attr: IRdsAttribute;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Edit;

Dict := MObj As IRdsDictionary;

Attrs := Dict.Attributes;

Attr := Attrs.Add;

Attr.DataType := DbDataType.Integer;

Attr.Id := "UserAttr";

Attr.Name := Additional attribute;

Attr.Nullable := True;

MObj.Save;

End Sub Main;

After executing the example an additional attribute is created in the MDM dictionary.

See also:

IRdsAttributes