InitInstance(Src: IDimInstance; op: DynamicInstanceOperationsVisibility; Mark: Variant);
Src. Dictionary;
op. Parameter determines to which dictionaries executed operation is applied;
Mark. Set to which dictionary will belong.
The InitInstance method initializes dictionary.
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(Null) As 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: