IMetabaseObjectCacheItem.Refresh

Syntax

Refresh;

Description

The Refresh method refreshes record in object cache.

Comments

On executing this method, the instance of the object that is stored in this cache record, will be changed for the instance of the object that was received after opening the last version with the ParamValues parameters.

Example

Executing the example requires that the repository contains a regular report with the Report_1 identifier. The regular report has two parameters: Param_1 and Param_2.

Sub UserProc;
Var
    MB: IMetabase;
    MDesc: IMetabaseObjectDescriptor;
    Cache: IMetabaseObjectCache;
    CacheItem: IMetabaseObjectCacheItem;
    Params: IMetabaseObjectParamValues;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    MDesc := MB.ItemById("Report_1");
    Params := MDesc.Params.CreateEmptyValues;
    Params.FindById("Param_1").Value := 2000;
    Params.FindById("Param_2").Value := 2003;
    Cache := MDesc.Cache;
    For i := 0 To Cache.Count - 1 Do
        CacheItem := Cache.Item(i);
        If Params.EqualTo(CacheItem.ParamValues) Then
            CacheItem.Refresh;
        End If;
    End For;
End Sub UserProc;

After executing the example the record that was created for the object with the specified value of parameters, is searched in the object cache. If the record was found in cache, it is refreshed.

See also:

IMetabaseObjectCacheItem