Community
Showing results for 
Search instead for 
Do you mean 
Reply

Creating a Task via SDK (2007 9.0)

Tuned Listener
Posts: 9
Country: United States

Creating a Task via SDK (2007 9.0)

Hi,

 

   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!

Tuned Listener
Posts: 9
Country: United States

Re: Creating a Task via SDK (2007 9.0)

Aynone???

Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Creating a Task via SDK (2007 9.0)

Hiya,

 

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!

 

HTH

 

Viv

 

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
New Member
Posts: 1
Country: United States

Re: Creating a Task via SDK (2007 9.0)

I have had luck adding an activity for one user using this:

 

cContactSelectedUser = cList2(ii) ' User assigned the activity

Dim cdg As CalendarDelegateGrantor = ActFwk.CalendarDelegates.GetCalendarDelegateGrantorByAccessorId(cContactSelectedUser.ID)

 

'Get contact

cList = ActFwk.Contacts.GetContactsByID(Nothing, guids)

cContact = cList(0) 'Contact to whom the activity is attached

 

 

'Create a new Activity

 Dim 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.ActivityContacts.Add(cContact)

 

NewActivity.Priority = aPriority

NewActivity.Type = aType

NewActivity.IsTimeless = False

NewActivity.Update()

 

hth

Jim