10-17-2008 03:13 PM
I want to create a reocurring pattern for an Activity. However, it seems that the reocurring fields in the activity are read-only. Hence, the question: "How does one create a reocurring pattern for an Activity?"
I use vb.net 2005
Thanx in advance...
T
10-23-2008 08:55 AM
Hey T,
I actually run into the same problems and unfortunatly I haven't found a work around. It looks like it might be a defect in the SDK we'll find out. The property you want to assign to is newActivity.RecurPeriod = ActivityRecurPeriod.Daily; but this is failing. I will get this into our tracking system and hopefully have a fix by the next update.
- Logan
10-23-2008 12:38 PM
Thanx. So currently it is not possible to set a recurring activity in ACT! using the SDK.
There's something strange going on with the recurring activities in ACT!. I've had a few customers where invalid recurring activities corrupts their Activities database and they can't see ANY activity when they list the activities in ACT!. I wrote an application and found out that when the Activities are retrieved, an "invalid recur instance" error occurs and none of the activities can be retrieved. The SDK should be modified so that the activities can be retrieved even if the recur pattern is invalid. If the recur pattern is invalid, it should be cleared by the retrieval.
The only way to regain access to the Activities database is to open it with SQL Studio and then clear all the recuring patterns (since I really do not know which one is invalid). Once that is done, you can then access the Activities database.
Also, do you know how to set a contact's suffix and prefix? These fields are read-only and can't be set. How does one set them?
01-19-2009 10:39 AM
01-20-2009 01:46 AM
In vb....
'create the activity here Dim activity As Act.Framework.Activities.ActivityTemplate = ActApp.ActFramework.Activities.CreateActivity(activityType, DateToSchedule, DateToSchedule, ActApp.ActFramework.CurrentUser.ID) 'set the recurrence, I have already collected the desired recurrence frequency from a form but its just
an enum you can pick yourself If Not recurrence = Nothing Then Dim reccurspec As New Act.Framework.Activities.ActivityRecurSpec(1, recurrence, Act.Framework.Activities.ActivityRecurModifier.None, New Act.Framework.Activities.ActivityRecurDay(activity.OccurTime.Day), activity.OccurTime.Month, Date.Now, True) activity.SetRecurSpecValues(reccurspec) End If 'save the activity activity.update
Note that setting this value "ActivityRecurSpec(1," to 0 causes ACT! to crash and you have to run the activity fix from actdiag, I'm not sure why it allows this.
Tom
01-27-2009 01:22 PM
Tom,
Thanx a lot. I'm going to give that a try.
Is there anywhere where I can find information on the different parameters on the creation of the recurring pattern?
I'm trying to create daily, weekly, monthly, yearly patterns with all the different patterns in them. Is there anywhere where I can find info on this?
Thanx a lot.
Thatch
01-28-2009 01:03 AM
Nowhere I know of sorry; I only found the bit above with trial and error, I guess you just need to have a play with the different parameters.
Tom
01-29-2009 12:44 PM
Tom,
Thanx for the info. I did try what you gave me and it works! Hurray!
I'll be playing with the parameters and see what I can come up with.
Thanx again.
Tom
02-02-2009 02:26 PM
Another example, this one in C#:
Hope this provides some additional info.
/******************* Test Code **********************/
ActivityTemplate newActivity = ActApp.ActFramework.Activities.CreateActivity(StandardActivityType.Meeting);
newActivity.Regarding = "This is a sample Activity";
//pass the activity to My Record
newActivity.ActivityContacts.Add(ActApp.ActFramework.Contacts.GetMyRecord());
newActivity.RecurPeriod = ActivityRecurPeriod.Daily; //ENUM
newActivity.Update();
/**************************************************************/
02-16-2009 06:26 PM
Thank you for the code you have all provided me. However, I am having problems creating a simple
recuring, daily event. Nothing fancy, just to see if this works. Also, I have tried it with ACT! 11.0 and 11.1.
Same result.
I am trying to just create a daily recurring event i.e. every day, once as day, recurring every day.
This is the code below:
reccurspec = New Act.Framework.Activities.ActivityRecurSpec
reccurspec.Period = ActivityRecurPeriod.Daily
reccurspec.DayType = ActivityRecurDayType.Typed
reccurspec.Frequency = 1
reccurspec.Month = 0
reccurspec.Period = ActivityRecurPeriod.Daily
ACT_ActivityTemplate.SetRecurSpecValues(reccurspec)
The resulting activity in ACT! is a Daily Recurrence but only on a weekday.
What am I doing wrong?
T