AFAnalysis.FindAnalysesByTemplate Method (AFDatabase, AFAnalysisTemplate, AFSortField, AFSortOrder, Int32, Int32)
- Last UpdatedNov 18, 2025
- 4 minute read
- PI System
- AF SDK 2024 R2
- Developer
Note: This API is now obsolete.
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 'AFAnalysisSearch' class using the 'Template' filter.")] public static AFNamedCollectionList<AFAnalysis> FindAnalysesByTemplate( AFDatabase database, AFAnalysisTemplate template, AFSortField sortField, AFSortOrder sortOrder, int startIndex, int maxCount )
<BrowsableAttribute(false)> <ObsoleteAttribute("This method has been replaced by the 'AFAnalysisSearch' class using the 'Template' filter.")> Public Shared Function FindAnalysesByTemplate ( database As AFDatabase, template As AFAnalysisTemplate, sortField As AFSortField, sortOrder As AFSortOrder, startIndex As Integer, maxCount As Integer ) As AFNamedCollectionList(Of AFAnalysis) Dim database As AFDatabase Dim template As AFAnalysisTemplate Dim sortField As AFSortField Dim sortOrder As AFSortOrder Dim startIndex As Integer Dim maxCount As Integer Dim returnValue As AFNamedCollectionList(Of AFAnalysis) returnValue = AFAnalysis.FindAnalysesByTemplate(database, template, sortField, sortOrder, startIndex, maxCount)
public: [BrowsableAttribute(false)] [ObsoleteAttribute(L"This method has been replaced by the 'AFAnalysisSearch' class using the 'Template' filter.")] static AFNamedCollectionList<AFAnalysis^>^ FindAnalysesByTemplate( AFDatabase^ database, AFAnalysisTemplate^ template, AFSortField sortField, AFSortOrder sortOrder, int startIndex, int maxCount )
[<BrowsableAttribute(false)>] [<ObsoleteAttribute("This method has been replaced by the 'AFAnalysisSearch' class using the 'Template' filter.")>] static member FindAnalysesByTemplate : database : AFDatabase * template : AFAnalysisTemplate * sortField : AFSortField * sortOrder : AFSortOrder * startIndex : int * maxCount : int -> AFNamedCollectionList<AFAnalysis>
Parameters
- database
- Type: OSIsoft.AFAFDatabase
The AFDatabase to search for the requested objects. - template
- Type: OSIsoft.AF.AnalysisAFAnalysisTemplate
Specify that the returned analyses must have this template. If , then all analyses without any template will be returned. - 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: AFNamedCollectionListAFAnalysisReturns a collection containing the specified page of AFAnalysis objects that are instantiated from the specified AFAnalysisTemplate.
Remarks
For AF 2.7 or later servers, this method is equivalent to calling the FindAnalyses(AFDatabase, String, String, NullableInt16, AFCategory, AFAnalysisTemplate, AFElement, AFStatus, AFSortField, AFSortOrder, Int32, Int32) method and only specifying template parameter. For older servers, this method is equivalent to calling the FindAnalyses(AFDatabase, String, AFSearchField, AFSortField, AFSortOrder, Int32, Int32, Int32) method and specifying Template for the search field and the template name for the query.
If the total count of objects is not needed, then this method will provide better performance than the method that returns the total count.
| Consider using the new AFAnalysisSearch class for finding analyses 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.4Obsolete (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