AFNotificationRule.SetStatus Method (IList(AFNotificationRule), AFStatus)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Set the AFNotificationRule status.
Set the list of AFNotificationRule to the specified status.
Namespace: OSIsoft.AF.Notification
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static AFErrors<AFNotificationRule> SetStatus( IList<AFNotificationRule> notificationRules, AFStatus newStatus )
Public Shared Function SetStatus ( notificationRules As IList(Of AFNotificationRule), newStatus As AFStatus ) As AFErrors(Of AFNotificationRule) Dim notificationRules As IList(Of AFNotificationRule) Dim newStatus As AFStatus Dim returnValue As AFErrors(Of AFNotificationRule) returnValue = AFNotificationRule.SetStatus(notificationRules, newStatus)
public: static AFErrors<AFNotificationRule^>^ SetStatus( IList<AFNotificationRule^>^ notificationRules, AFStatus newStatus )
static member SetStatus : notificationRules : IList<AFNotificationRule> * newStatus : AFStatus -> AFErrors<AFNotificationRule>
Parameters
- notificationRules
- Type: System.Collections.GenericIListAFNotificationRule
The list of AFNotificationRule to have their Status set to the specified newStatus value. - newStatus
- Type: OSIsoft.AF.AnalysisAFStatus
The new AFStatus for the AFNotificationRule.
Return Value
Type: AFErrorsAFNotificationRuleAn AFErrorsTKey object containing any AFNotificationRule that generated errors. Returns if no errors.
Exceptions
| Exception | Condition |
|---|---|
| SecurityException | This exception is thrown when the user does not have Write permission on one of the AFNotificationRule in the specified list. |
| ArgumentException | This exception can be thrown if one of the items in the notificationRules list has been deleted. |
Remarks
This method will set all the AFNotificationRule in the list to the same AFStatus in a single
call to the server. This is more efficient than setting the Status property of
each AFNotificationRule.