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

AF SDK Reference

AFCase.FindCases Method (AFAnalysis, AFSearchMode, Object, Object, String, AFCategory, AFElementTemplate, AFSortField, AFSortOrder, Int32)

AFCase.FindCases Method (AFAnalysis, AFSearchMode, Object, Object, String, AFCategory, AFElementTemplate, AFSortField, AFSortOrder, Int32)

  • Last UpdatedNov 18, 2025
  • 6 minute read
AFCase.FindCases Method (AFAnalysis, AFSearchMode, Object, Object, String, AFCategory, AFElementTemplate, AFSortField, AFSortOrder, Int32)

Note: This API is now obsolete.

Retrieves a list of AFCase objects that match the specified filtering conditions.

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

Syntax

[BrowsableAttribute(false)]
[ObsoleteAttribute("This method has been replaced by the 'AFCaseSearch' class using the 'Start', 'End', 'Name', 'Category', and 'Template' filters.")]
public static AFNamedCollectionList<AFCase> FindCases(
	AFAnalysis analysis,
	AFSearchMode searchMode,
	Object startTime,
	Object endTime,
	string nameFilter,
	AFCategory elemCategory,
	AFElementTemplate elemTemplate,
	AFSortField sortField,
	AFSortOrder sortOrder,
	int maxCount
)
<BrowsableAttribute(false)>
<ObsoleteAttribute("This method has been replaced by the 'AFCaseSearch' class using the 'Start', 'End', 'Name', 'Category', and 'Template' filters.")>
Public Shared Function FindCases ( 
	analysis As AFAnalysis,
	searchMode As AFSearchMode,
	startTime As Object,
	endTime As Object,
	nameFilter As String,
	elemCategory As AFCategory,
	elemTemplate As AFElementTemplate,
	sortField As AFSortField,
	sortOrder As AFSortOrder,
	maxCount As Integer
) As AFNamedCollectionList(Of AFCase)

Dim analysis As AFAnalysis
Dim searchMode As AFSearchMode
Dim startTime As Object
Dim endTime As Object
Dim nameFilter As String
Dim elemCategory As AFCategory
Dim elemTemplate As AFElementTemplate
Dim sortField As AFSortField
Dim sortOrder As AFSortOrder
Dim maxCount As Integer
Dim returnValue As AFNamedCollectionList(Of AFCase)

returnValue = AFCase.FindCases(analysis, 
	searchMode, startTime, endTime, nameFilter, 
	elemCategory, elemTemplate, sortField, 
	sortOrder, maxCount)
public:
[BrowsableAttribute(false)]
[ObsoleteAttribute(L"This method has been replaced by the 'AFCaseSearch' class using the 'Start', 'End', 'Name', 'Category', and 'Template' filters.")]
static AFNamedCollectionList<AFCase^>^ FindCases(
	AFAnalysis^ analysis, 
	AFSearchMode searchMode, 
	Object^ startTime, 
	Object^ endTime, 
	String^ nameFilter, 
	AFCategory^ elemCategory, 
	AFElementTemplate^ elemTemplate, 
	AFSortField sortField, 
	AFSortOrder sortOrder, 
	int maxCount
)
[<BrowsableAttribute(false)>]
[<ObsoleteAttribute("This method has been replaced by the 'AFCaseSearch' class using the 'Start', 'End', 'Name', 'Category', and 'Template' filters.")>]
static member FindCases : 
        analysis : AFAnalysis * 
        searchMode : AFSearchMode * 
        startTime : Object * 
        endTime : Object * 
        nameFilter : string * 
        elemCategory : AFCategory * 
        elemTemplate : AFElementTemplate * 
        sortField : AFSortField * 
        sortOrder : AFSortOrder * 
        maxCount : int -> AFNamedCollectionList<AFCase> 

Parameters

analysis
Type: OSIsoft.AF.AnalysisAFAnalysis
The AFAnalysis to search for the requested objects.
searchMode
Type: OSIsoft.AF.AssetAFSearchMode
Determines how the startTime and endTime parameters are treated when searching for case objects to be included in the returned collection.
startTime
Type: SystemObject
An object representing the starting time for the search. The startTime must be less than or equal to the endTime. The searchMode parameter will control whether the comparison will be performed against the case's StartTime or EndTime. The value may be an AFTime, DateTime, PITime, String, or numeric. A DateTime (or a DATE will be treated as UTC time if its Kind property is set to Unspecified. Because DATE values from COM or VB6 clients are marshalled as Unspecified, these client applications must convert to UTC prior to marshalling. An integer numeric represents the number of ticks (100-nanosecond intervals) since January 1, 0001. A floating point numeric represents the number of seconds since January 1, 1970 UTC. A String is interpreted as local time, unless it contains a time zone indicator such as a trailing "Z" or "GMT". Strings will be interpreted with the AFTime.Parse Overload methods so that relative formats with intervals ("*", "T+3h", etc.) are also supported. Relative time intervals are based on the object's QueryDate.
endTime
Type: SystemObject
An object representing the ending time for the search. The endTime must be greater than or equal to the startTime. The searchMode parameter will control whether the comparison will be performed against the case's StartTime or EndTime. The value may be an AFTime, DateTime, PITime, String, or numeric. A DateTime (or a DATE will be treated as UTC time if its Kind property is set to Unspecified. Because DATE values from COM or VB6 clients are marshalled as Unspecified, these client applications must convert to UTC prior to marshalling. An integer numeric represents the number of ticks (100-nanosecond intervals) since January 1, 0001. A floating point numeric represents the number of seconds since January 1, 1970 UTC. A String is interpreted as local time, unless it contains a time zone indicator such as a trailing "Z" or "GMT". Strings will be interpreted with the AFTime.Parse Overload methods so that relative formats with intervals ("*", "T+3h", etc.) are also supported. Relative time intervals are based on the object's QueryDate.
nameFilter
Type: SystemString
The case name filter 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'.

elemCategory
Type: OSIsoft.AFAFCategory
Specify that returned cases must have this category. To not filter by element category, then specify for this parameter.
elemTemplate
Type: OSIsoft.AF.AssetAFElementTemplate
Specify that returned cases must have this template or a template derived from this template. To not filter by element template, then specify for this parameter.
sortField
Type: OSIsoft.AFAFSortField
The field or property of the object used to sort the returned collection.
sortOrder
Type: OSIsoft.AFAFSortOrder
The order that the returned collection is sorted.
maxCount
Type: SystemInt32
The maximum number of objects to be returned.

Return Value

Type: AFNamedCollectionListAFCase
Returns a collection containing the specified page of AFCase objects which match the specified filters.

Remarks

A case must be saved to the server using ApplyChanges or CheckIn before it will be returned by this find method. This method will return a list of cases within a time range.

Important note Important
Consider using the new AFCaseSearch class for finding cases instead of using this method.

Version Information

AFSDK

Supported in: 2.8.5, 2.8, 2.7.5, 2.7, 2.6, 2.5, 2.4
Obsolete (compiler warning) in 3.1.1
Obsolete (compiler warning) in 3.1.0
Obsolete (compiler warning) in 3.0.2
Obsolete (compiler warning) in 3.0.1
Obsolete (compiler warning) in 3.0.0
Obsolete (compiler warning) in 2.10.11
Obsolete (compiler warning) in 2.10.5
Obsolete (compiler warning) in 2.10.0
Obsolete (compiler warning) in 2.10
Obsolete (compiler warning) in 2.9.5
Obsolete (compiler warning) in 2.9

See Also

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