IDimAttributesInstance.EnsureValuesLoaded

Syntax

EnsureValuesLoaded(AttributeKeys: Array; Option: Integer; Filter: IDimSelection);

EnsureValuesLoaded(AttributeKeys: System.Array; Option: integer; Filter: Prognoz.Platform.Interop.Dimensions.IDimSelection);

Parameters

AttributeKeys. Keys of loaded attributes.

Option. Option of attribute values loading.

Filter. Dictionary selection by which attributes are additionally loaded.

Description

The EnsureValuesLoaded method additionally dynamically loads attributes of dimension elements.

Comments

The Option parameter gets values available for DimAttributeInstanceValuesLoadOptions.

Example

Executing the example requires a dictionary with the DIC identifier.

Add links to the Metabase, Dimensions system assemblies.

Sub Main;
Var
    MB: IMetabase;
    Dimen: IDimInstance;
    Attrs: IDimAttributesInstance;
    Ar: Array 
Of integer;
    Selection: IDimSelection;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    Dimen := MB.ItemById(
"DIC").Open(NullAs IDimInstance;
    Attrs := Dimen.Attributes;
    Ar := 
New integer[Attrs.Count];
    
For i := 0 To Attrs.Count - 1 Do
        Ar[i] := Attrs.Item(i).Attribute.Key;
    
End For;
    
// Set up selection by which attributes must be additionally loaded
    Selection := Dimen.CreateSelection;
    Selection.SelectAll;
    
// Additionally load attributes
    Attrs.EnsureValuesLoaded(Ar, DimAttributeInstanceValuesLoadOptions.DisplayValue, Selection);
End Sub Main;

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Dimensions;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Dimen: IDimInstance;
    Attrs: IDimAttributesInstance;
    Ar: Array 
Of uinteger;
    Selection: IDimSelection;
    i, DimAtr: Integer;
Begin
    MB := Params.Metabase;
    Dimen := MB.ItemById[
"DIC_ME"].Open(NullAs IDimInstance;
    Attrs := Dimen.Attributes;
    Ar := 
New uinteger[Attrs.Count];
    
For i := 0 To Attrs.Count - 1 Do
        Ar[i] := Attrs.Item[i].Attribute.Key;
    
End For;
    
// Set up selection by which attributes must be additionally loaded
    Selection := Dimen.CreateSelection();
    Selection.SelectAll();
    
//Set option of attributes values loading
    DimAtr:= DimAttributeInstanceValuesLoadOptions.daivloDisplayValue.value__;
    
// Additionally load attributes
    Attrs.EnsureValuesLoaded(Ar,DimAtr,Selection);
End Sub;

As a result of the example execution, attributes of dimension elements will be dynamically loaded.

See also:

IDimAttributesInstance