Community
Showing results for 
Search instead for 
Do you mean 
Reply

Recurring Madness - Need a List of Activities That Works

Nickel Super Contributor
Posts: 352
Country: Canada

Recurring Madness - Need a List of Activities That Works

My request is pretty simple, yet I haven't been able to find the right method for this...

 

I need a list of activities for a given user for a specific date.  The reason is to go through that list and find the next available timeslot, or confirm that the day is booked up.

 

I've tried GetTaskListItems, but it doesn't seem to include recurring activities.  There is a FirstInstanceRestriction, but even if I set it to None, I don't get the recurring activities included in the list.

 

I tried GetActivitiesForAvailability, but it throws a null reference error that seems deep within the Act Framework.

 

GetActivityList doesn't provide recurring activities either.

 

Is there a method that will reliably return all activities, including recurring instances, for a given range?  I'm not picky on specific users, I'll filter those out after I get a list if needed.

 

Thanks in advance!

Len

Len Kamerman
ACT! Certified Consultant

Act E-mail Marketing Trainining Course:

http://actsoftware.training
Copper Elite Contributor
Posts: 81
Country: Canada

Re: Recurring Madness - Need a List of Activities That Works

I think for this you might have to use the OleDb provider and get a list of activities after filtering on the activity time. I personally haven't worked with Oledb much but I threw together some code which seems to return a list of IDs while filtering on the start time column. For the code below you will need a reference to System.Data.Linq

 

IDbConnection connection = new OleDbConnection(_actFwk.CurrentACTOLEDB2);
DataContext db = new DataContext(connection);

Table<ACTIVITYTABLE> activities = db.GetTable<ACTIVITYTABLE>();

var query =
                from activity in activities
                where activity.ACTIVITYID != null &&
                activity.StartTime < DateTime.Now
                select activity;

foreach (var activity in query)
          MessageBox.Show(activity.ACTIVITYID.ToString());
    [Table(Name = "ACTIVITY")]
    public class ACTIVITYTABLE
    {
        [Column(IsPrimaryKey=true)]
        public Guid ACTIVITYID { get; set; }

        [Column(Name = "START_DATE_TIME")]
        public DateTime StartTime { get; set; }
    }
Ahsan Khalid

Chief Technology Officer
Keystroke Quality Computing Inc.
www.keystroke.ca

Silver Super Contributor
Posts: 2,328
Country: USA

Re: Recurring Madness - Need a List of Activities That Works

I use GetActivityList with an empty criteria filter and a start date and end date and I'm pretty sure that it retrieves recurring activities.

 

Stan


If you would like to get more out of ACT! you can find an ACT! Certified Consultant near you by going to:www.act.com/acc.
-------------------------------------------------------------------------------------
Stan Smith
ACT! Certified Consultant
ADS Programming Services, Inc.
(205) 222-1661
www.adsprogramming.com
www.actwebhosting.com
Click Here to Purchase Act!