Community
Showing results for 
Search instead for 
Do you mean 
Reply

Creating Reoccuring Pattern for an Activity

New Member
Posts: 31
Country: USA

Creating Reoccuring Pattern for an Activity

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

Copper Contributor
Posts: 91
Country: USA

Re: Creating Reoccuring Pattern for an Activity

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

New Member
Posts: 31
Country: USA

Re: Creating Reoccuring Pattern for an Activity

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?

 

Champion Listener
Posts: 32
Country: Canada

Re: Creating Reoccuring Pattern for an Activity

Try using actActivity.RecurSpec property to set recurring pattern for new activities.
Nickel Super Contributor
Posts: 441
Country: UK

Re: Creating Reoccuring Pattern for an Activity

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

New Member
Posts: 31
Country: USA

Re: Creating Reoccuring Pattern for an Activity

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

Nickel Super Contributor
Posts: 441
Country: UK

Re: Creating Reoccuring Pattern for an Activity

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

New Member
Posts: 31
Country: USA

Re: Creating Reoccuring Pattern for an Activity

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

Copper Contributor
Posts: 98
Country: United States

Re: Creating Reoccuring Pattern for an Activity

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();
/**************************************************************/ 

Carlton Jones
Sage Software
New Member
Posts: 31
Country: USA

Re: Creating Reoccuring Pattern for an Activity

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