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

AF SDK Reference

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

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

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

Namespace:  OSIsoft.AF.Notification
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

AFNotificationRule.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 AFNotificationRule to have their Status set to the specified newStatus value. Specify to set the status for all AFNotificationRule objects within the database. The filtered AFNotificationRule can be limited by the oldStatus parameter if specified.

The following types of filter objects can be specified:

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

newStatus
Type: OSIsoft.AF.AnalysisAFStatus
The new AFStatus for the AFNotificationRule objects.
oldStatus (Optional)
Type: OSIsoft.AF.AnalysisAFStatus
The old AFStatus for the AFNotificationRule objects that are to be updated. Only AFNotificationRule objects with the specified old status will be updated. To update all AFNotificationRule objects 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 AFNotificationRule based upon a filter object to the same AFStatus in a single call to the server. If the optional oldStatus is specified, then only AFNotificationRule that match the old status will be updated. This is more efficient than setting the Status property of each AFNotificationRule.

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

See Also

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