3 Replies Latest reply on Jun 6, 2017 12:22 PM by Dan Fishman

    AFEventFrameSearch get last event before certain time


      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?