Community
Showing results for 
Search instead for 
Do you mean 
Reply

Framework.Activities

New Member
Posts: 1
Country: UK

Framework.Activities

Hi, this is my first post and my first time coding with the ACT sdk so bear with me Smiley Indifferent.

I am trying to create new activity's in ACT. I can assign all the fields except:  ScheduledWith, ScheduledFor, ScheduledBy and AlarmDue.

If i try use these fields in my code i get a compiling error stating : 

 

 

Error    8    Property or indexer 'Act.Framework.Activities.ActivityTemplate.ScheduledWith' cannot be assigned to -- it is read only.

 

 

 

Im not sure if iv created the activity object correctly, my code looks like this:

 

 

Act.Framework.Activities.ActivityTemplate aTemplate;
            Act.Framework.Activities.ActivityType[] aTypes = ActFramework.Framework.foFrameWork.Activities.GetActivityTypes(false);
            Act.Framework.Activities.ActivityPriority pTypes = ActFramework.Framework.foFrameWork.Activities.GetActivityPriority(priority);
            Act.Framework.Activities.ActivityType aType;
            DateTime sDateTime;
            Act.Framework.Contacts.Contact oContact;
            aType = aTypes[4];
            
                oContact = Contacts.returnContact(actID);
                
                switch(type)
                {   
                    case 0:
                        aType = aTypes[0];
                        break;
                    case 1:
                        aType = aTypes[1];
                        break;
                    case 2:
                        aType = aTypes[2];
                        break;
                    case 3:
                        aType = aTypes[3];
                        break;
                    case 4:
                        aType = aTypes[4];
                        break; 
                }
              
                aTemplate = Framework.oFrameWork.Activities.CreateActivity(aType);
                aTemplate.ActivityContacts.Add(oContact);
                aTemplate.Regarding = regarding;
                aTemplate.Priority = pTypes;
                aTemplate.Details = details;
                aTemplate.StartTime = startTime;
                aTemplate.EndTime = endTime;
                aTemplate.IsPrivate = isPrivate;
                aTemplate.ScheduledWith = "test";
                aTemplate.Update();

 

 

 

 Any help will be much appreciated.

Adrian 

New Member
Posts: 5
Country: USA

Re: Framework.Activities

from the looks of that error I would have to assume that ScheduledWith is a collection. Which makes sense since you can Schedule an activity with one contact or more.

 

 

Nickel Super Contributor
Posts: 441
Country: UK

Re: Framework.Activities

The schedule with property is readonly - I haven't tried this but try using the .setcompanies or the .setgroups or the SetEntityID() methods instead.

 

Tom