AFNotifications.Add Method (String, AFNotificationTemplate, AFBaseElement)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Note: This API is now obsolete.
This method is used to create a new AFNotification
based upon the specified template.
Namespace: OSIsoft.AF.Notification
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
[BrowsableAttribute(false)] [ObsoleteAttribute("This method has been replaced by the constructor 'AFNotification(AFDatabase,string,AFNotificationTemplate,AFBaseElement)'.")] public AFNotification Add( string name, AFNotificationTemplate template, AFBaseElement target )
<BrowsableAttribute(false)> <ObsoleteAttribute("This method has been replaced by the constructor 'AFNotification(AFDatabase,string,AFNotificationTemplate,AFBaseElement)'.")> Public Function Add ( name As String, template As AFNotificationTemplate, target As AFBaseElement ) As AFNotification Dim instance As AFNotifications Dim name As String Dim template As AFNotificationTemplate Dim target As AFBaseElement Dim returnValue As AFNotification returnValue = instance.Add(name, template, target)
public: [BrowsableAttribute(false)] [ObsoleteAttribute(L"This method has been replaced by the constructor 'AFNotification(AFDatabase,string,AFNotificationTemplate,AFBaseElement)'.")] AFNotification^ Add( String^ name, AFNotificationTemplate^ template, AFBaseElement^ target )
[<BrowsableAttribute(false)>] [<ObsoleteAttribute("This method has been replaced by the constructor 'AFNotification(AFDatabase,string,AFNotificationTemplate,AFBaseElement)'.")>] member Add : name : string * template : AFNotificationTemplate * target : AFBaseElement -> AFNotification
Parameters
- name
- Type: SystemString
The name for the new AFNotification object. The name must be unique within the collection. If the name ends with an asterisk (*), then a unique name will be generated based on the supplied name. See the ValidateName(String, String) method for a description of what is valid when setting the name of the object. - template
- Type: OSIsoft.AF.NotificationAFNotificationTemplate
The template that is to be used to create the new AFNotification object. Any template can be used as long as its InstanceType is AFNotification or a type derived from AFNotification. If , then the notification is created without a template and properties normally defined by the template will be defined by the notification instead. - target
- Type: OSIsoft.AF.AssetAFBaseElement
If the template parameter is specified and the notification template's AnalysisTemplate property is specified, then this parameter specifies the Target for the new AFAnalysis that is created from the AFAnalysisTemplate defined by the analysis template's Target property. If the template parameter is or the notification template's AnalysisTemplate property is , then this parameter is ignored.
Return Value
Type: AFNotificationReturns the newly added AFNotification object.
Remarks
The type of AFNotification created by this method is determined by the template's InstanceType property. By default, the type will be AFNotification, but could be any type derived from an AFNotification.
The default value of the Description property of the new notification is the same as the description of the template; however, it can be changed by the user. All other properties are defined by the template and cannot be modified without changing the template.
Version Information
AFSDK
Obsolete (compiler warning) in 3.1.1Obsolete (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
Obsolete (compiler warning) in 2.8.5
Obsolete (compiler warning) in 2.8
Obsolete (compiler warning) in 2.7.5
Obsolete (compiler warning) in 2.7
Obsolete (compiler warning) in 2.6
Obsolete (compiler warning) in 2.5
Obsolete (compiler warning) in 2.4