08-23-2011 01:30 PM
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!
08-24-2011 07:17 AM
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(null, null, 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.
08-24-2011 05:30 AM
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.
08-24-2011 06:57 AM
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!
08-24-2011 07:17 AM
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(null, null, 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.
08-27-2011 12:43 PM
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