AFNotification.SetStatus Method (IList(AFNotification), AFStatus, String)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Set the list of notifications to the specified status and error message.
Namespace: OSIsoft.AF.Notification
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static void SetStatus( IList<AFNotification> notifications, AFStatus status, string errorMessage )
Public Shared Sub SetStatus ( notifications As IList(Of AFNotification), status As AFStatus, errorMessage As String ) Dim notifications As IList(Of AFNotification) Dim status As AFStatus Dim errorMessage As String AFNotification.SetStatus(notifications, status, errorMessage)
public: static void SetStatus( IList<AFNotification^>^ notifications, AFStatus status, String^ errorMessage )
static member SetStatus : notifications : IList<AFNotification> * status : AFStatus * errorMessage : string -> unit
Parameters
- notifications
- Type: System.Collections.GenericIListAFNotification
The list of analyses to have their Status set to the specified status value and optionally have their ErrorMessage set to the specified errorMessage value. - status
- Type: OSIsoft.AF.AnalysisAFStatus
The new AFStatus for the notifications. - errorMessage
- Type: SystemString
The new error message associated with an error status for the notifications. If this parameter is , then the ErrorMessage will not be modified. To clear the error message, set this parameter to an empty string.
Exceptions
| Exception | Condition |
|---|---|
| SecurityException | This exception is thrown when the user does not have Write permission on one of the notifications in the specified list. |
| ArgumentException | This exception can be thrown if one of the items in the notifications list has been deleted. |
Remarks
This method will set all the notifications in the list to the same AFStatus and
error message (if specified) in a single call to the server. This is more efficient than setting the
Status and ErrorMessage properties of each notification.