07-22-2010 01:57 AM
I'm developing a plugin for ACT! 2008 which should do such things:
- get all activities for current user by organizeuserid
- create a HTML page which should look similar to ACT! report, with some changes in grouping and sorting
The user should determine the timespan of reports (with DateTimePickers) and grouping methods but it is not that important now.
My problem lies in recurring activities. Typically, the ACT! report shows all occurences of recurring activities and that is what I also want to achieve, but now I can only get the activity itself and not all the occurences. I examined the ACT! Database structure and I have such a conclusion - it can be achieved by writing methods in VS calculating all occurence dates, but with all this dependencies (for instance - second thursday of march, monday and tuesday every week, etc.) writing such a program will be quite hard (I'm new in ACT! programming and mid-experienced in .NET). So my question is that - is there any easier solution that allows me to get all the occurencies of recurring activities in a particular period of time (for example, this month)? Something in ACT! SDK maybe, or direct from database itself?
07-22-2010 07:00 AM - edited 07-22-2010 07:09 AM
The GetActivites methods don't filter out recurring activities unless you choose to via filter criteria. So for instance :
ActivityList al =
Will return every activity for the current contact regardless of whether it recurs or not, along with all of the occurrences of that activity within a time period that can also be specified via overloads for this method
Also for your question regarding the type of reccurence can be answered via properties of the activities you capture in the activity list, Activity.RecurSpec will give the specifics of the rucurrence type, ie. Every Wednesday @ 6:00 untill 11/26/2010.
This might be helpful as well, I put together a string showing all the data that is returned when you requrest the various recur properties of an activity
RecurSpec: Occurs every Wednesday until 11/26/2009.
After reading back through I think I might have failed to answer your question on getting all the occurrences of a particular recurring activity within a giving time period. Since they'll all have the same EventName, you can just trim down your activity list within a given time period where EventName== the EventName property of the reoccuring activity your looking for. There are other comparators you could use as well, but EventName seemed the easiest.
Hope this helps.
07-28-2010 07:29 AM
Matthew, thank you for your help. It seems that the method you provided works brilliant with appropriate filters. I have developed a solution without it (using SQL connections to ACT! database and solution I mentioned) but now I can write something with shorter code.
I also wonder, why some field descriptors are connected to the tables I cannot see in the database. For instance, descriptor Activity.OccurDate refers to a table dbo.TBL_ACTIVITY_OCCURRENCES, which is not shown in table list in SQL Server Management Studio. Can somebody explain, why?