IMetabaseObjectCache.Put

Syntax

Put(Instance: IMetabaseObjectInstance);

Parameters

Instance - instance of an object that should be put to cache.

Description

The Put method creates a new record in cache and puts the specified object instance to it.

Comments

Records for objects opened with different parameter values are created in cache. If cache contains a record for the same parameters that were used to get an instance of the Instance object, when executing the Put method this record is updated.

Example

Executing the example requires that the repository contains a regular report with the Report_1 identifier.

Sub UserProc;
Var
    MB: IMetabase;
    MDesc: IMetabaseObjectDescriptor;
    Cache: IMetabaseObjectCache;
    Params: IMetabaseObjectParamValues;
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;
    Cache.Put(MDesc.Open(Params));
End Sub UserProc;

After executing the example a new record is created in cache of a regular report.

See also:

IMetabaseObjectCache