AFAuditTrail Class
- Last UpdatedNov 18, 2025
- 4 minute read
- PI System
- AF SDK 2024 R2
- Developer
Provides audit trail information for the requested PISystem.
Inheritance Hierarchy
SystemObject
OSIsoft.AF.DiagnosticsAFAuditTrail
OSIsoft.AF.DiagnosticsAFAuditTrail
Namespace: OSIsoft.AF.Diagnostics
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
[SerializableAttribute] public class AFAuditTrail
<SerializableAttribute> Public Class AFAuditTrail Dim instance As AFAuditTrail
[SerializableAttribute] public ref class AFAuditTrail
[<SerializableAttribute>] type AFAuditTrail = class end
The AFAuditTrail type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| AFAuditTrail |
Create an AFAuditTrail instance to read audit trail events for the requested PISystem.
|
Methods
| Name | Description | |
|---|---|---|
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
| GetDetails |
Get the list of audit trail details that occurred for the requested row in the DataTable, returned by
previously calling AFAuditTrailGetFirst, GetNext, or GetPrevious.
| |
| GetFirst(AFTimeRange, Int32) |
Read audit trail events from the PISystem for the requested time range up to the specified maximum count.
| |
| GetFirst(AFObject, Boolean, AFTimeRange, Int32) |
Read audit trail events from the PISystem for the requested time range up to the specified maximum count.
| |
| GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
| GetNext |
Read next page of audit trail events for the originally requested inputs.
If AFAuditTrailGetFirst has not been called, then GetNext will throw invalid parameter error.
| |
| GetPrevious |
Read previous page of audit trail events for the originally requested inputs.
If AFAuditTrailGetFirst and GetNext has not been called, then GetPrevious
will throw invalid parameter error.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| ToString | Returns a string that represents the current object. (Inherited from Object.) |
Remarks
The Audit Trail requires the calling user to have administrative permissions.
To retrieve audit trail events for the requested PISystem, call the
AFAuditTrailGetFirst method and read the first page of
audit trail events for the requested inputs. If there is more data for the requested inputs then call the GetNext
method to read the next page of results. Continue to call the GetNext method until the originally requested
endTime has been reached.
The GetDetails(DataRow) method can be used to retrieve information about the before and after values for a data row
in a DataTable that was returned by having called one of the audit trail read methods.