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

AF SDK Reference

AFEventFrame.FindEventFrames Method (AFDatabase, AFEventFrame, String, AFSearchField, Boolean, AFSortField, AFSortOrder, Int32, Int32)

AFEventFrame.FindEventFrames Method (AFDatabase, AFEventFrame, String, AFSearchField, Boolean, AFSortField, AFSortOrder, Int32, Int32)

  • Last UpdatedNov 18, 2025
  • 5 minute read
AFEventFrame.FindEventFrames Method (AFDatabase, AFEventFrame, String, AFSearchField, Boolean, AFSortField, AFSortOrder, Int32, Int32)
Performs a paged text search within the AFDatabase to retrieve a collection of AFEventFrame objects which have a field that matches the specified query string.

Namespace:  OSIsoft.AF.EventFrame
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static AFNamedCollectionList<AFEventFrame> FindEventFrames(
	AFDatabase database,
	AFEventFrame searchRoot,
	string query,
	AFSearchField field,
	bool searchFullHierarchy,
	AFSortField sortField,
	AFSortOrder sortOrder,
	int startIndex,
	int maxCount
)
Public Shared Function FindEventFrames ( 
	database As AFDatabase,
	searchRoot As AFEventFrame,
	query As String,
	field As AFSearchField,
	searchFullHierarchy As Boolean,
	sortField As AFSortField,
	sortOrder As AFSortOrder,
	startIndex As Integer,
	maxCount As Integer
) As AFNamedCollectionList(Of AFEventFrame)

Dim database As AFDatabase
Dim searchRoot As AFEventFrame
Dim query As String
Dim field As AFSearchField
Dim searchFullHierarchy As Boolean
Dim sortField As AFSortField
Dim sortOrder As AFSortOrder
Dim startIndex As Integer
Dim maxCount As Integer
Dim returnValue As AFNamedCollectionList(Of AFEventFrame)

returnValue = AFEventFrame.FindEventFrames(database, 
	searchRoot, query, field, searchFullHierarchy, 
	sortField, sortOrder, startIndex, 
	maxCount)
public:
static AFNamedCollectionList<AFEventFrame^>^ FindEventFrames(
	AFDatabase^ database, 
	AFEventFrame^ searchRoot, 
	String^ query, 
	AFSearchField field, 
	bool searchFullHierarchy, 
	AFSortField sortField, 
	AFSortOrder sortOrder, 
	int startIndex, 
	int maxCount
)
static member FindEventFrames : 
        database : AFDatabase * 
        searchRoot : AFEventFrame * 
        query : string * 
        field : AFSearchField * 
        searchFullHierarchy : bool * 
        sortField : AFSortField * 
        sortOrder : AFSortOrder * 
        startIndex : int * 
        maxCount : int -> AFNamedCollectionList<AFEventFrame> 

Parameters

database
Type: OSIsoft.AFAFDatabase
The AFDatabase to search for the requested objects.
searchRoot
Type: OSIsoft.AF.EventFrameAFEventFrame
The root object to start the search. If , then the search starts at the AFDatabase.
query
Type: SystemString
The query string used for finding objects.

The query string (or match pattern) can include regular characters and wildcard characters. Regular characters must match exactly the characters specified in the query string. Wildcard characters can be matched with arbitrary fragments of the query string. Wildcard characters can be escaped using the single backslash (\) character. Use a double backslash (\\) to match a single backslash. The syntax of the query string has the following rules:

  • If or empty string, then everything will be matched.
  • If no wildcards, then an exact match on the query string is performed.
  • Wildcard * can be placed anywhere in the query string and matches zero or more characters.
  • Wildcard ? can be placed anywhere in the query string and matches exactly one character.
  • One character in a set of characters are matched by placing them within [ ]. For example, a[bc] would match 'ab' or 'ac', but it would not match 'ad' or 'abd'.
  • One character in a set of characters are not matched by placing them within [! ]. For example, a[!bc] would match 'ad', but it would not match 'ab', 'ac', or 'abd'.
  • A character in a range of characters from first to last are matched using the following syntax: [first - last]. For example, a[a-c] would match 'aa', 'ab', or 'ac', but it would not match 'ad' or 'abc'.

field
Type: OSIsoft.AFAFSearchField
Specifies which of the object's properties are searched.
searchFullHierarchy
Type: SystemBoolean
Specifies if the search should include objects nested further than the immediate children of the searchRoot.
sortField
Type: OSIsoft.AFAFSortField
The field or property of the object used to sort the returned collection. This value should not be changed between calls when attempting to get the next page of items.
sortOrder
Type: OSIsoft.AFAFSortOrder
The order that the returned collection is sorted. This value should not be changed between calls when attempting to get the next page of items.
startIndex
Type: SystemInt32
The starting index (zero based) of the items to be returned.
maxCount
Type: SystemInt32
The maximum number of objects to be returned per call (the page size).

Return Value

Type: AFNamedCollectionListAFEventFrame
Returns the collection containing the specified page of AFEventFrame objects which match the specified query string.

Remarks

An event frame must be saved to the server using ApplyChanges or CheckIn before it will be returned by this find method. An object matches the search if the specified query is found in one of the object's properties specified by the field parameter.

This will only return objects of type AFEventFrame. Types of event frames that inherit from AFEventFrame will not be returned. Use the specific find methods to return types of event frames that inherit from AFEventFrame.

Important note Important
Consider using the new AFEventFrameSearch class for finding event frames instead of using this method.

Version Information

AFSDK


See Also

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