02-16-2009 07:12 PM
I have spent all day on this and basically gotten NOWHERE!!!! How can one make recurring patterns so difficult???
Anyway, I need to create the following recurences (basically all of them) and I am looking for code for them. Here's
a brief breakdown on the recurrences:
Daily, every 1 day.
Daily, every N days
Weekly, on certain days of the week, for example monday, wed, and friday
Weekly, every N Weeks, on certain days of the week, for example monday, wed, and friday
Monthly, every N months, on an X day of the month
Monthly, every N Monhs, on the (first, second, third, fourth, last) Day or Weekday of the month
Yearly, Every N Years, on a date of that year
Yearly, Every N Years, on the (first, second, third, fourth, last) Day or Weekday of Y month
The only recurrence that I have managed to create is Daily, Only on Weekdays. Everything else does not get registered by the ACT! Framework.
Thanx in advance for ANY tips and tricks
T
02-16-2009 10:55 PM - edited 02-16-2009 11:37 PM
I spent all day today figuring out the recurring events and finally got most of it.
For the life of me I can't seem to be able to generate a simple Daily Recurring Event that goes off every 4 days.
reccurspec = New Act.Framework.Activities.ActivityRecurSpec
Reccurspec.Frequency = 4
reccurspec.Month = 0
reccurspec.Period = ActivityRecurPeriod.Daily
ACT_ActivityTemplate.SetRecurSpecValues(reccurspec)
No matter what I do, the recurring pattern becomes a Daily Recurring Pattern that only fires during the week. Does anyone have a clue here?
02-17-2009 05:16 AM
I'm using this code (in C#) and it works fine for me:
....
recurSpec.Period = ActivityRecurPeriod.Daily;
recurSpec.Modifier = ActivityRecurModifier.None;
recurSpec.DayType = ActivityRecurDayType.Typed;
recurSpec.Month = 0;
recurSpec.Frequency = 4;
//for Daily - every day
recurSpec.Day = new ActivityRecurDay( ActivityRecurTypedDay.Day );
//for Daily - every weekday
recurSpec.Day = new ActivityRecurDay( ActivityRecurTypedDay.Weekday );
.....
Katerina
02-18-2009 12:21 PM
The code works! Thanx Katerina.
I was doing the same thing but in a different order and it just would not work. It now works great. Thanx.
T