MBanchuzhnyy

How to know number of Notification History Records

Discussion created by MBanchuzhnyy on Nov 8, 2011
Latest reply on Nov 9, 2011 by MBanchuzhnyy

Hello everybody,

 

 

 

I'm writing notification web service which allows to retrieve notification history. The question is, is it possible to know number of history records without execution time consuming statements like this: 

 

 

 

// Step 1 - get all notification objects

 

ANNotificationList notificationList = new ANNotificationList(AFNotification.FindNotifications( AFDatabase, "", AFSearchField.Name, AFSortField.Name, AFSortOrder.Ascending, 10000));

 

 

 

// Step 2 - get all history records 

List<ANNotificationInstances> notificationInstances = notificationList.GetInstances(startTime, endTime));

 

 

 

// Step 3 - analize histiory records one by one 

foreach (ANNotificationInstances instances in notificationInstances)

{

...

}

Thank you.

 

 

 

 

Step 2  takes a lot of time in case there are a lot of records in the history, but I need to know number of records before going through all of them (the purpose of that is time assessment). In other words, is there in API capability to get just number of history records for each notification object. Maybe there is some static information class which I cannot find?

 

 

 

 

Outcomes