IMetaAttribute.HasMultipleValues

Syntax

HasMultipleValues: Boolean;

Description

The HasMultipleValues property determines whether an element may have multiple values by this attribute. True - elements may have multiple values.

Comments

The attribute can support multiple values if its type is Link to the Dictionary (see MetaAttributeKind).

Example

Executing the example requires that the repository contains a time series database with the OBJ_FC identifier and an MDM repository with the RDS_REPO identifier. The MDM repository must have the dictionary with the DICT_COUNTRY identifier.

Sub Main;
Var
    MB: IMetabase;
    Rubr: IRubricator;
    Facts: IMetabaseObject;
    Att: IMetaAttribute;
    CollectionAtt: IMetaAttributes;
Begin
    MB := MetabaseClass.Active;
    Rubr := MB.ItemById("OBJ_FC").Bind As IRubricator;
    Facts := (Rubr.Facts As IMetabaseObject).Edit;
    Att := (Facts As IMetaDictionary).Attributes.Add;
    Att.DataType := DbDataType.Integer;
    Att.Id := "A_M_REF";
    Att.Name := New attribute;
    Att.Kind := (MetaAttributeKind.Collection) Or (MetaAttributeKind.Dimension);
    Att.ValuesObject := MB.ItemByIdNamespace("DICT_COUNTRY", Mb.ItemById("RDS_REPO").Key);
    Att.DataType := DbDataType.Integer;
    Att.HasMultipleValues := True;
    CollectionAtt := Att.CollectionAttributes;
    CollectionAtt.BuildCollectionAttributes;
    CollectionAtt.CreateTable(True);
    Facts.Save;
End Sub Main;

After executing the example, the attribute named New Attribute is added to the dictionary that contains information about time series of the database with the OBJ_FC identifier. This attribute is a link to the dictionary and supports multiple values. A system table is also created to store multiple values.

See also:

IMetaAttribute