IDynamicInstance.InitInstance

Syntax

InitInstance(Src: IDimInstance; op: DynamicInstanceOperationsVisibility; Mark: Variant);

Parameters

Src. Dictionary;

op. Parameter determines to which dictionaries executed operation is applied;

Mark. Set to which dictionary will belong.

Description

The InitInstance method initializes dictionary.

Example

Executing the example requires that repository contains MDM table dictionary with the DYNDIM identifier.

Add links to the Dimensions and Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Dim: IDynamicInstance;
    DimInst: IDimInstance;
Begin
    MB := MetabaseClass.Active;
    DimInst := MB.ItemById("DYNDIM").Open(NullAs IDimInstance;
    Dim := New DynamicInstance.Create;
    // Initialize dictionary
    Dim.InitInstance(DimInst, DynamicInstanceOperationsVisibility.Local, "Init");
    // Display dictionary name - data source
    Debug.WriteLine("Dictionary name: " + Dim.RootInstance.Name);
    // Display number of parent dictionary attributes
    Debug.WriteLine("Attributes in parent dictionary: " + 
        Dim.ParentInstance.AttributeCount.ToString);
End Sub UserProc;

After executing the example the console displays name of the dictionary - data source, number of attributes in parent dictionary.

See also:

IDynamicInstance