Community
Showing results for 
Search instead for 
Do you mean 
Reply

How to Set the Scheduled For field in an Activity

Astute Commentator
Posts: 168
Country: United States

How to Set the Scheduled For field in an Activity

Does anyone know how does one change the "Scheduled For" of an ACT! Activity programmatically?

 

There appears to be no field or method that allows the modification of the Scheduled For on an activity. What am I missing?

 

I just want to change the Scheduled For from one user to another.

 

Any clues?

 

Thank you in advance.

 

T

Employee
Posts: 1,163
Country: USA

Re: How to Set the Scheduled For field in an Activity

The organizer for an activity is whom it is scheduled for, the activity contacts are those whom the activity is scheduled with.

Matthew Wood
Act! SDK Support
Community Moderator
Astute Commentator
Posts: 168
Country: United States

Re: How to Set the Scheduled For field in an Activity

I know that. However, what I want is to change with whom the activity is Scheduled For. Like on the ACT! interface where you can choose the contact to Schedule For . 

 

Anybody have any code on this?

 

T

Employee
Posts: 1,163
Country: USA

Re: How to Set the Scheduled For field in an Activity

Maybe I don't understand the question.

 

If you change who the activity organizer is, it changes who the activity is ScheduledFor. They are one in the same.

Matthew Wood
Act! SDK Support
Community Moderator
Astute Commentator
Posts: 168
Country: United States

Re: How to Set the Scheduled For field in an Activity

I looked at the Activity object and I don't see any call to set the Organizer. I guess the question is:

   What code is needed to change an activity's organizer?

 

T

Employee
Posts: 1,163
Country: USA

Re: How to Set the Scheduled For field in an Activity

This does it for a newly created activity, I'm farily certain you can set the organizer the same way for an existing activity:

 

User[] users = ActApp.ActFramework.Users.ActiveUsers;
CalendarDelegateGrantor cdg = ActApp.ActFramework.CalendarDelegates.GetCalendarDelegateGrantorByAccessorId(users[users.Length - 1].ID);
ActivityTemplate newActivity = ActApp.ActFramework.Activities.CreateActivity(StandardActivityType.Meeting);


newActivity.ActivityContacts.Add(contact);
newActivity.Regarding = "SDK TEST";
newActivity.StartTime = startTime;
newActivity.EndTime = endTime;
newActivity.Details = " ";
newActivity.Organizer = cdg;
newActivity.IsAlarmed = true;
newActivity.LeadMinutes = 10;
newActivity.Update();
Matthew Wood
Act! SDK Support
Community Moderator
Astute Commentator
Posts: 168
Country: United States

Re: How to Set the Scheduled For field in an Activity

Matt,

 

THANX A LOT. THAT HELPS

 

 Smiley Happy

Astute Commentator
Posts: 168
Country: United States

Re: How to Set the Scheduled For field in an Activity

BTW.

 

This worked great on previous version of Act!. With Act! 17.2, this does not work. So if, for example, John schedules for Patrick, the organizer is still John.

 

Any clues on how to work around this?

 

T