IRdsDictionary.DefaultElementKey

Syntax

DefaultElementKey: Integer;

DefaultElementKey: uinteger;

Description

The DefaultElementKey property determines a default element by its key.

Comments

If the default element is not set, the property returns -1.

Example

Executing the example requires that the repository contains a table MDM dictionary with the RDS_DICT_OBJ identifier. The key of one of the elements is equal to 11.

Add links to the Metabase, Rds system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Obj: IMetabaseObject;
    Dict: IRdsDictionary;
Begin
    
// Get current repository
    MB := MetabaseClass.Active;
    
// Get table MDM dictionary
    Obj := MB.ItemById("RDS_DICT_OBJ").Edit;
    Dict := Obj 
As IRdsDictionary;
    
// Set default element key in table MDM dictionary
    Dict.DefaultElementKey := 11;
    
// Save dictionary
    Obj.Save;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Rds;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Obj: IMetabaseObject;
    Dict: IRdsDictionary;
Begin
    
// Get current repository
    MB := Params.Metabase;
    
// Get table MDM dictionary
    Obj := MB.ItemById["RDS_DICT_OBJ"].Edit();
    Dict := Obj 
As IRdsDictionary;
    
// Set default element key in table MDM dictionary
    Dict.DefaultElementKey := 11;
    
// Save dictionary
    Obj.Save();
End Sub;

After executing the example the element with the 11 key is set as a default element in the dictionary.

See also:

IRdsDictionary