Community
Showing results for 
Search instead for 
Do you mean 
Reply

retrieve history for a contact within a specific date or for a range.

Copper Contributor
Posts: 41
Country: USA

retrieve history for a contact within a specific date or for a range.

How would I retrive history for a specific contact within a specfic date.

 

I tried using .DateFilterCriteria.CalculateDateRange and I can not get it to work. Has anybody used this before. Or can someone point me in the right direction.

 

-Bob Lozinak

Bob Lozinak
Twelve/Three Marketing, Inc.
Software Developer
Employee
Posts: 1,163
Country: USA

Re: retrieve history for a contact within a specific date or for a range.

You're on the right track, you'll probably need to use both a DateFilterCriteria to narrow by date and a ComparisonFilterCriteria to filter by contacts unless you do so when retrieving the histories. Using the DateFilterCriteria would look something like this:

 

DateTime StartTime = System.DateTime.Parse("8/18/2000 1:15:00 PM");
DateTime EndTime = System.DateTime.Now.AddYears(10);

DBFieldDescriptor EditDate = _ActApp.ActFramework.Contacts.GetFieldDescriptor("TBL_CONTACT.EDITDATE", true);
IFilterCriteria[] DateFilter = new IFilterCriteria[1];
DateFilter[0] = new DateFilterCriteria(EditDate, StartTime, EndTime);

 

One of the overloads for the GetHistories methods accepts both a filter criteria and a contact as a parameter. Hope this helps.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 41
Country: USA

Re: retrieve history for a contact within a specific date or for a range.

Thanks Matt, it seems so easy!

 

-Bob

Bob Lozinak
Twelve/Three Marketing, Inc.
Software Developer