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

AF SDK Reference

AFNotification.LoadNotifications Method (PISystem, Guid[], Object)

AFNotification.LoadNotifications Method (PISystem, Guid[], Object)

  • Last UpdatedNov 18, 2025
  • 5 minute read
AFNotification.LoadNotifications Method (PISystem, Guid[], Object)
Loads the AFNotification objects with the specified unique identifiers at the specified query date.

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

Syntax

public static AFNamedCollectionList<AFNotification> LoadNotifications(
	PISystem system,
	Guid[] ids,
	Object queryDate
)
Public Shared Function LoadNotifications ( 
	system As PISystem,
	ids As Guid(),
	queryDate As Object
) As AFNamedCollectionList(Of AFNotification)

Dim system As PISystem
Dim ids As Guid()
Dim queryDate As Object
Dim returnValue As AFNamedCollectionList(Of AFNotification)

returnValue = AFNotification.LoadNotifications(system, 
	ids, queryDate)
public:
static AFNamedCollectionList<AFNotification^>^ LoadNotifications(
	PISystem^ system, 
	array<Guid>^ ids, 
	Object^ queryDate
)
static member LoadNotifications : 
        system : PISystem * 
        ids : Guid[] * 
        queryDate : Object -> AFNamedCollectionList<AFNotification> 

Parameters

system
Type: OSIsoft.AFPISystem
The PISystem to search for the desired objects.
ids
Type: SystemGuid
An array of the unique identifiers of the objects to load.
queryDate
Type: SystemObject
The query date used to load the objects. Specify or AFTime.MaxValue for most recent versions of the objects. The value may be an AFTime, DateTime, PITime, String, or numeric. A DateTime (or a DATE will be treated as UTC time if its Kind property is set to Unspecified. Because DATE values from COM or VB6 clients are marshalled as Unspecified, these client applications must convert to UTC prior to marshalling. An integer numeric represents the number of ticks (100-nanosecond intervals) since January 1, 0001. A floating point numeric represents the number of seconds since January 1, 1970 UTC. A String is interpreted as local time, unless it contains a time zone indicator such as a trailing "Z" or "GMT". Strings will be interpreted with the AFTime.Parse Overload methods so that relative formats with intervals ("*", "T+3h", etc.) are also supported. Relative time intervals are based on AFTime.Now.

Return Value

Type: AFNamedCollectionListAFNotification
Returns a collection of the objects in the system which match the unique identifiers in the ids list at the specified queryDate. If no object can be found for a unique identifier in the list, there will be no corresponding entry in the returned collection. The order of items in the returned collection might not match the order of specified ids, but the returned collection items can be accessed by ID.

Remarks

Fully loads the AFNotification objects from the server into the client with the specified ids at the specified queryDate. If the object is already loaded in memory, then it will be updated if it has been marked as needing to reload by a call to AFDatabaseRefresh. If you do not need the objects fully loaded, you can use the FindNotifications(PISystem, Guid, Object) method which will only load the headers for each object.

Examples

// Loading a list of Notifications for display is a common task whose performance can be
// greatly improved by using bulk retrieval methods.Notifications typically reference several other top-level
// AF Objects, such as Analyses, Analysis Templates, Elements, Element Templates, and Element paths.
// This example uses several methods to illustrate how to load such a list.

// Get the Default Database
PISystems myPISystems = new PISystems();
AFDatabase myDB = myPISystems.DefaultPISystem.Databases.DefaultDatabase;
if (myDB == null)
    throw new InvalidOperationException("Database was not found.");

// Find notifications to load.  As with all top-level objects, the
// notifications returned are only partially loaded into memory.  
AFNamedCollectionList<AFNotification> notifications =
    AFNotification.FindNotifications(myDB, "", AFSearchField.Name, AFSortField.Name, AFSortOrder.Ascending, 100);

// The LoadNotifications call will fully load the notification into memory.
// The second parameter indicates whether the analysis should be loaded as well.
// For example, if you were going to display or edit analysis information, you would
// set this parameter to true.
AFNotification.LoadNotifications(notifications, false);

// Notifications target other AFObjects.  We can cause those to be loaded via this call.
// Note that typically, notifications target single AFElements, however, in the future,
// there may be other types of objects targeted.
IList<object> targets = AFNotification.LoadTargets(notifications, false);

// Now output the notifications.  There should be no more calls to the server at this point.
foreach (AFNotification notification in notifications)
{
    AFObject target = notification.Target as AFObject;
    if (target != null)
        Console.WriteLine("{0}: {1}", notification, target.GetPath());
    else
        Console.WriteLine("{0}: {1}", notification, notification.Target);
}
' Loading a list of Notifications for display is a common task whose performance can be
' greatly improved by using bulk retrieval methods.Notifications typically reference several other top-level
' AF Objects, such as Analyses, Analysis Templates, Elements, Element Templates, and Element paths.
' This example uses several methods to illustrate how to load such a list.

' Get the Default Database
Dim myPISystems As New PISystems()
Dim myDB As AFDatabase = myPISystems.DefaultPISystem.Databases.DefaultDatabase
If myDB Is Nothing Then
    Throw New InvalidOperationException("Database was not found.")
End If

' Find notifications to load.  As with all top-level objects, the
' notifications returned are only partially loaded into memory.  
Dim notifications As AFNamedCollectionList(Of AFNotification) =
    AFNotification.FindNotifications(myDB, "", AFSearchField.Name, AFSortField.Name, AFSortOrder.Ascending, 100)

' The LoadNotifications call will fully load the notification into memory.
' The second parameter indicates whether the analysis should be loaded as well.
' For example, if you were going to display or edit analysis information, you would
' set this parameter to true.
AFNotification.LoadNotifications(notifications, False)

' Notifications target other AFObjects.  We can cause those to be loaded via this call.
' Note that typically, notifications target single AFElements, however, in the future,
' there may be other types of objects targeted.
Dim targets As IList(Of Object) = AFNotification.LoadTargets(notifications, False)

' Now output the notifications.  There should be no more calls to the server at this point.
For Each notification As AFNotification In notifications
    Dim target As AFObject = TryCast(notification.Target, AFObject)
    If target IsNot Nothing Then
        Console.WriteLine("{0}: {1}", notification, target.GetPath())
    Else
        Console.WriteLine("{0}: {1}", notification, notification.Target)
    End If
Next

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

Version Information

AFSDK


See Also

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