Community
Showing results for 
Search instead for 
Do you mean 
Reply

Filter Histories by history ID

New Member
Posts: 14
Country: United_Kingdom

Filter Histories by history ID

I am trying to write a routine that will always update the right history, in this routine historys are kept in a tempary SQL table. I am trying to use "HistoryID" as a filter requirement but on the line bellow I get and error saying "Requested value 'HISTORY ID' was not found"

 

Dim hfd, hfd2 As HistoryFieldDescriptor

hfd2 = oActFwk.Histories.GetFieldDescriptor("HISTORYID")

 

 

Employee
Posts: 1,163
Country: USA

Re: Filter Histories by history ID

The reason the exception is being thrown is because there isn't a field descriptor for history ID. 

 

To filter a list of histories (and most other objects in Act) we need to use the IFilterCriteria interface and create a new ComparisonFIlterCriteria object. The pseudocode would be something like:

 

IFilterCriteria criteria = new ComparisonFilterCriteria(historyID, ComparisonFilterCriteria.Operator.Equals, History.ID)

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 5
Country: Canada

Re: Filter Histories by history ID

Hi Mike,

 

What PropertyDescriptor/DBFieldDescriptor/HistoryFieldDescriptor (or other class) would you use for the historyid object you have below?

Scott