AnsweredAssumed Answered

AFEventFrameSearch get last event before certain time

Question asked by Nocodes79 Champion on Jun 6, 2017
Latest reply on Jun 6, 2017 by Dan Fishman

Hi all,

 

I would like to find the last EventFrame of a certian type before current EventFrame. I am using the follwing:

AFEventFrameSearch prevENDEFSearch =
     new AFEventFrameSearch(referencedElement.Database, "PREVEND",
          AFEventFrameSearchMode.BackwardFromStartTime,((AFTimeRange)timeContext).StartTime, queryString);

This will get all events with a certain template before a date, but I need only the last of them.

I suppose this implies much more work than just finding the last of them internally. Is there a way to directly get only the last of them?

Outcomes