Community
Showing results for 
Search instead for 
Do you mean 
Reply

Getting a list of Activities before a certain date, in a plugin

Accepted Solution Solved
Copper Super Contributor
Posts: 88
Country: USA
Accepted Solution

Getting a list of Activities before a certain date, in a plugin

I'd like to be able to get an "ActivitiesList" of all open Activities before a certain date - either by each Contact, or by the current ContactList.

 

Any recommendations on code to get that list?

 

Thanks!


Accepted Solutions
Solution
Accepted by topic author kimkamp22
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Getting a list of Activities before a certain date, in a plugin

Sorry, but I don't have anything in VB, there are some translators out there, I believe Jim Durkin posted a good one recently. But hopefully it's still clear

 

ActivityList al = 
                ActApp.ActFramework.Activities.GetActivitiesForContact(ActApp.ApplicationState.CurrentContact, FirstInstanceRestriction.FirstUnclearedOccurrence);
ActivityList allActivities = ActApp.ActFramework.Activities.GetActivityList(nullnull, startDate, endDate);

The first ActivityList will get all the activities for the current contact. The second, assuming the start and end dates are sufficient, will get all the activities.

Matthew Wood
Act! SDK Support
Community Moderator

View solution in original post


All Replies
Employee
Posts: 1,163
Country: USA

Re: Getting a list of Activities before a certain date, in a plugin

There are a couple of different options for accomplishing this. First, the GetActivitiesForContact method in the ActivityManager class has overloads that accept DateTime, additionally you can use IActivityFilterCriteria and create a DateTimeCriteria to filter your ActivityList with.

 

 

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

Re: Getting a list of Activities before a certain date, in a plugin

Thanks for the reply.

 

Would you be able to list some vb.NET code to get both Activities lists - one for a Contact, and one for all Contacts?

 

I'm most interested in getting the Activities list for all Contacts, but both would be very helpful!

 

Thanks!

Solution
Accepted by topic author kimkamp22
‎09-25-2015 03:20 AM
Employee
Posts: 1,163
Country: USA

Re: Getting a list of Activities before a certain date, in a plugin

Sorry, but I don't have anything in VB, there are some translators out there, I believe Jim Durkin posted a good one recently. But hopefully it's still clear

 

ActivityList al = 
                ActApp.ActFramework.Activities.GetActivitiesForContact(ActApp.ApplicationState.CurrentContact, FirstInstanceRestriction.FirstUnclearedOccurrence);
ActivityList allActivities = ActApp.ActFramework.Activities.GetActivityList(nullnull, startDate, endDate);

The first ActivityList will get all the activities for the current contact. The second, assuming the start and end dates are sufficient, will get all the activities.

Matthew Wood
Act! SDK Support
Community Moderator
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Getting a list of Activities before a certain date, in a plugin

The free on-line converter for C# to VB is

http://www.developerfusion.com/tools/convert/csharp-to-vb/

 

I am sure there are many others well regarded sites.

This is the one I have used for years. It does a great job at VB to c# also.

 

-- Jim Durkin