AFAuditTrail.GetFirst Method (AFTimeRange, Int32)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Read audit trail events from the PISystem for the requested time range up to the specified maximum count.
Namespace: OSIsoft.AF.Diagnostics
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public DataTable GetFirst( AFTimeRange timeRange, int maxCount )
Public Function GetFirst ( timeRange As AFTimeRange, maxCount As Integer ) As DataTable Dim instance As AFAuditTrail Dim timeRange As AFTimeRange Dim maxCount As Integer Dim returnValue As DataTable returnValue = instance.GetFirst(timeRange, maxCount)
public: DataTable^ GetFirst( AFTimeRange timeRange, int maxCount )
member GetFirst : timeRange : AFTimeRange * maxCount : int -> DataTable
Parameters
- timeRange
- Type: OSIsoft.AF.TimeAFTimeRange
Time range for reading audit trail events from the PISystem. - maxCount
- Type: SystemInt32
Maximum number of audit trail events to return in the requested time range.
Return Value
Type: DataTableReturns a DataTable containing the audit trail events for the requested timeRange or until the specified maxCount is reached. If the returned DataTable contains maxCount events, then use GetNext to walk to next set of events in the originally requested time range.
Remarks
This method returns the first page of audit trail events within the requested timeRange
up to the specified maxCount. The GetNext method can be used
to read the next page of audit trail events if they are not all returned when calling this method.
The details for an event can be read using the GetDetails(DataRow) method.