Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFAuditTrail.GetFirst Method (AFTimeRange, Int32)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFAuditTrail.GetFirst Method (AFTimeRange, Int32)
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: DataTable
Returns 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.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6

See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in