Community
Showing results for 
Search instead for 
Do you mean 
Reply

ComparisonFilterCriteria & GetHistories

New Member
Posts: 5
Country: Canada

ComparisonFilterCriteria & GetHistories

Hi folks,

 

Just wondering if anyone has much experience out there using ComparisonFilterCriteria Objects with GetHistories() method of the HistoryManager?

 

I ask, because I seem unable to make any ComparisonFilterCriteria work on any fields that aren't actually in TBL_HISTORY. For example, if I want to get a set of Histories, where it's based on attachment file extension (say ".txt" files) I would use the following code:

 

String FileTypeString = ".txt";
Object FileTypeStringObject = (Object)FileTypeString;

IFilterCriteria[] CompanyHistoryFilterCriteria = {
        new ComparisonFilterCriteria (

                Framework.Histories.GetFieldDescriptor("AttachmentFileExtension"),
                ComparisonFilterCriteria.Operation.Equals,
                FileTypeStringObject

        )

};

 

HistoryList CompanyHistory = Framework.Histories.GetHistories(

        CompanyHistorySortCriteria,
        MyCompany,
        AggregationType.All,
        CompanyHistoryFilterCriteria,
        false

);


I get 0 results using this code even though I do have documents of ".txt" clearly in the list. So, am I right in guessing that I can only right comparison filters against the columns in TBL_HISTORY when making a GetHistories call?

 

Thanks!

 

Scott

 

PS - It would be really nice, for debugging purposes, to see the T-SQL Statements being generated by these filters and method calls - would make it a lot easier to troubleshoot what's going wrong.

 

 

Employee
Posts: 1,163
Country: USA

Re: ComparisonFilterCriteria & GetHistories

Hello there and welcome to the community.

 

I've been working with this for a bit now myself and have run into similar issues. As a debug throug, the left hand argument where the AttachmentFileExtension should be returning the value of the field descriptor, it's instead returning T5.Displayname for both that column and the AttachmentFileType property. I'm currently investigating whether this is the expected behavior.

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

Re: ComparisonFilterCriteria & GetHistories

Hi Matthew,

Just wondering if there was any news on this front?

Thanks!

Scott
Employee
Posts: 1,163
Country: USA

Re: ComparisonFilterCriteria & GetHistories

I can confirm that this is not the expected behavior and that we are working on a fix, at this time I don't have an estimate on when this will be resolved. 

Matthew Wood
Act! SDK Support
Community Moderator
Astute Commentator
Posts: 168
Country: United States

Re: ComparisonFilterCriteria & GetHistories

[ Edited ]

I posted this yesterday and did not get a response.

 

I read this tread and I have a question.

 

Has anyone managed to retrieve a History Item from the database by ID?

 

I've tried all kinds of mechanisms with each one failing worse than the other.

 

    I want to retrieve the history item by the history ID.

 

Does anyone have a working piece of code? I am using ACT! 16.

 

Thank you in advance.

 

T