GetHistory: IMetabaseObjectHistory;
The GetHistory method returns a history of changing the object.
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.
Executing the example requires that the repository contains an object with the ObjTest identifier.
Sub Main;
Var
MB: IMetabase;
Desc: IMetabaseObjectDescriptor;
Histor: IMetabaseObjectHistory;
Item: IMetabaseObjectHistoryItem;
i: Integer;
Begin
MB := MetabaseClass.Active;
Desc := Mb.ItemById("ObjTest");
Histor := Desc.GetHistory;
For i := 0 To Histor.Count - 1 Do
Item := Histor.Item(i);
Debug.WriteLine(Item.Id + " " + Item.Name + " " + ((Item.Stamp As Variant) As DateTime).ToString);
End For;
End Sub Main;
After executing the example information about the ObjTest object changing is displayed in the development environment console. Identifiers, names, date and time of objects changing are also displayed.
See also: