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

AF SDK Reference

AFAnalysis.SetStatus Method (AFDatabase, AFObject, AFStatus, AFStatus)

AFAnalysis.SetStatus Method (AFDatabase, AFObject, AFStatus, AFStatus)

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFAnalysis.SetStatus Method (AFDatabase, AFObject, AFStatus, AFStatus)
Sets all the analyses based upon a filter object to the specified status.

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

Syntax

public static void SetStatus(
	AFDatabase database,
	AFObject filter,
	AFStatus newStatus,
	AFStatus oldStatus = AFStatus.None
)
Public Shared Sub SetStatus ( 
	database As AFDatabase,
	filter As AFObject,
	newStatus As AFStatus,
	Optional oldStatus As AFStatus = AFStatus.None
)

Dim database As AFDatabase
Dim filter As AFObject
Dim newStatus As AFStatus
Dim oldStatus As AFStatus

AFAnalysis.SetStatus(database, filter, 
	newStatus, oldStatus)
public:
static void SetStatus(
	AFDatabase^ database, 
	AFObject^ filter, 
	AFStatus newStatus, 
	AFStatus oldStatus = AFStatus::None
)
static member SetStatus : 
        database : AFDatabase * 
        filter : AFObject * 
        newStatus : AFStatus * 
        ?oldStatus : AFStatus 
(* Defaults:
        let _oldStatus = defaultArg oldStatus AFStatus.None
*)
-> unit 

Parameters

database
Type: OSIsoft.AFAFDatabase
The AFDatabase to search for the requested objects.
filter
Type: OSIsoft.AFAFObject

The object to be used to filter the analyses to have their Status set to the specified newStatus value. Specify to set the status for all analyses within the database. The filtered analyses can be limited by the oldStatus parameter if specified.

The following types of filter objects can be specified:

Object TypeDescription
AFAnalysisTemplate The status for all analyses with the specified template will be set. Specify None as the filter for analyses with no template.
AFCategoryThe status for all analyses with the specified category will be set. Specify None as the filter for analyses with no categories.

newStatus
Type: OSIsoft.AF.AnalysisAFStatus
The new AFStatus for the analyses.
oldStatus (Optional)
Type: OSIsoft.AF.AnalysisAFStatus
The old AFStatus for the analyses that are to be updated. Only analyses with the specified old status will be updated. To update all analyses not having the newStatus, then specify None for this parameter.

Exceptions

ExceptionCondition
NotSupportedException This exception is thrown when calling this method and connected to an AF 2.6 or earlier server or if an unsupported filter is specified.

Remarks

This method will set all the analyses based upon a filter object to the same AFStatus in a single call to the server. If the optional oldStatus is specified, then only analyses that match the old status will be updated. This is more efficient than setting the Status property of each analysis.

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

See Also

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