IRdsUniqueKey.UseInSelection

Syntax

UseInSelection: Boolean;

Description

The UseInSelection property determines whether unique key is used on selection creating.

Comments

Available values:

Example

Executing the example requires that the repository contains MDM dictionary with the USE_IN_SELECTION identifier. This dictionary must be out of MDM repository and must be used only as dimension in time series database.

Add links to the Dal, Metabase and Rds system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Dict: IRdsDictionary;
    UniqueKeys: IRdsUniqueKeys;
    UniqueKey: IRdsUniqueKey;
    Attributes: IRdsAttributes;
    Attribute: IRdsAttribute;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get MDM dictionary
    Dict := mb.ItemById("USE_IN_SELECTION").Edit As IRdsDictionary;
    // Get dictionary unique keys
    UniqueKeys := Dict.UniqueKeys;
    // Add new key
    UniqueKey := UniqueKeys.Add;
    // Get dictionary attributes
    Attributes := Dict.Attributes;
    // Add new attribute
    Attribute := Attributes.Add;
    // Set name and type of attribute data
    Attribute.Name := "Unique key";
    Attribute.DataType := DbDataType.String;
    // Set that created attribute is included in the new unique key
    UniqueKey.Contains(Attribute) := True;
    // Set that unique key will be used on selection creating
    UniqueKey.UseInSelection := True;
    // Set that unique key is case-sensitive
    UniqueKey.CaseSensitive := True;
    // Save changes in the MDM dictionary
    (Dict As IMetabaseObject).Save;
End Sub UserProc;

After executing the example unique key, which can be used to store and restore selection by dimension based on this dictionary will be created in the MDM dictionary.

See also:

IRdsUniqueKey