Refresh;
The Refresh method refreshes records in the cache of object.
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 of the last version with the ParamValues parameters.
Executing this 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 cache of the object. If the records was found, it is refreshed.
See also: