02-21-2009 09:24 PM
I was trying to add a new task for specific number of contacts using an existing Activity Series Template (Using VB) and I've researched for quite sometime and did not find any idea on how to achieve this.
Thank you in advance!
02-24-2009 04:51 AM
I had a precursory look at the ActivitySeriesManager class and there is a ScheduleActivitySeries( ActivitySeries activitySeries,DateTime anchorDate) method but I am not sure how it is associated with a contact(s).
It could be that you might need to itterate through each of the ActivitySeriesItems via the ActivitySeriesList object, and assign the relevent ActivityContactCollection to each of the items in turn.
This seems like a very inefficient way of doing it I have to admit and maybe someone else might be able to come up with a more efficient way! I really hope there is since this a really ugly way!
03-04-2009 10:58 AM
I have had luck adding an activity for one user using this:
cContactSelectedUser = cList2(ii) ' User assigned the activityDim cdg As CalendarDelegateGrantor = ActFwk.CalendarDelegates.GetCalendarDelegateGrantorByAccessorId(cContactSelectedUser.ID)
'Get contactcList = ActFwk.Contacts.GetContactsByID(Nothing, guids)
cContact = cList(0) 'Contact to whom the activity is attached
'Create a new ActivityDim aType As ActivityType = ActFwk.Activities.GetActivityType("To-do")
Dim aPriority As ActivityPriority = ActFwk.Activities.GetActivityPriority("High")Dim NewActivity As ActivityTemplate = ActFwk.Activities.CreateActivity(atype, sDateTime, eDateTime, cdg)
NewActivity.Details = Me.tbDetails.Text.ToStringNewActivity.Regarding =Me.tbRegarding.Text.ToString
NewActivity.Priority = aPriority
NewActivity.Type = aType
NewActivity.IsTimeless = False