09-08-2011 03:25 AM
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")
09-08-2011 08:04 AM
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)