IMetabaseObjectDescriptor.GetHistory

Syntax

GetHistory: IMetabaseObjectHistory;

GetHistory(): Prognoz.Platform.Interop.Metabase.IMetabaseObjectHistory;

Description

The GetHistory method returns a history of changing the object.

Comments

To keep a history it is necessary to activate this function for the particular type of objects in the auditing of the security manager or for the particular object it is necessary to activate auditing for the determined user in the navigator of the security manager.

Example

Executing the example requires that the repository contains object with the OBJ9253 identifier.

Add links to the Metabase, Ui system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Desc: IMetabaseObjectDescriptor;
    Histor: IMetabaseObjectHistory;
    Item: IMetabaseObjectHistoryItem;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    Desc := Mb.ItemById(
"OBJ9253");
    Histor := Desc.GetHistory;
    
For i := 0 To Histor.Count - 1 Do
        Item := Histor.Item(i);
        Debug.WriteLine(Item.Id + 
" " + Item.Name + " " + DateTime.FromDouble(Item.Stamp).ToString);
    
End For;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Ui;
 
Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Desc: IMetabaseObjectDescriptor;
    Histor: IMetabaseObjectHistory;
    Item: IMetabaseObjectHistoryItem;
    i: Integer;
Begin
    MB := Params.Metabase;
    Desc := Mb.ItemById[
"OBJ9253"];
    Histor := Desc.GetHistory();
    
For i := 0 To Histor.Count - 1 Do
        Item := Histor.Item[i];
        System.Diagnostics.Debug.WriteLine(Item.Id + 
" " + Item.Name + " " + DateTime.FromOADate(Item.Stamp).ToString());
    
End For;
End Sub;

After executing the example information about the OBJ9253 object changing is displayed in the development environment console. Identifiers, names, date and time of objects changing are also displayed.

See also:

IMetabaseObjectDescriptor