10-04-2009 02:25 AM
I am working on creating a list of a days' activities (or a lookup and work from there) and then creating an email of those activites for office appointment remiders since the activity e-mail template is not accesible in Act 2009 and does not look like it is in 2010 either.
This needs to be done for each activity Any code (C# is best but will take VB of course) to help me pull a day's activities and extract the essential field of who, when, what, e-mail would be very helpful.
I am becoming more fluent in the ACT SDK coding but find the activity extraction (the actual activity details) bewildering from the reference material and do not want to reinvent the wheel. I do best with taking code samples as a base.
I know the essential detals of each activity pop up in a window when we mouse over them on the calender - even code to duplicate that would allow me to figure out access to these details.
If you would rather not post or a looking for reasonable compensation, my e-mail is firstname.lastname@example.org and I am hoping a few of you can help
Thank you in advance
10-06-2009 08:35 AM
If I asked for too much or seem to "green" for this group, then how about just pointing me in a direction for more detailed reading if no one has any code snippets to share.
10-06-2009 10:01 AM
Do you have a requirement on the version of ACT! you want this for? For what you are describing you can access the Activity API's or potentially use OLEDB2 Provider to extract the days Activities - OLEDB2 provider is only available in ACT! 2010 or higher. I have an example of OLEDB2 provider usage in code in the devnet download site. Taking the OLEDB2 approach would allow your code to exist outside of any ACT! references (though you would need to have the provider installed where you intend to run your code from).
10-06-2009 10:12 AM
10-06-2009 10:55 AM - edited 10-06-2009 12:55 PM
Thank you for your reply. I am currently developing this for version 2009 Standard. I was hoping to develop something that would also be viable for anyone else with this reminder e-mail issue due to the time involved. If there were an available add-on I would have gladly paid for it.
I am open to upgrading and developing it only for version 2010 unless anyone has other ideas that are less version specific.
Thank you for jumping in. I can usually find my way through from documentation and samples but felt at a loss on this/
10-06-2009 01:44 PM
10-07-2009 01:44 AM
In vb but hopefully it will give you something to work with....
'create the sort criteria to sort the activities in ascending order Dim sCriteria As New Act.Framework.Activities.ActivitySortCriteria(ActApp.ActFramework.Activities.GetFieldDescriptor("STARTTIME"), System.ComponentModel.ListSortDirection.Ascending) 'get the activities and sort them by date Dim aList As Act.Framework.Activities.ActivityList aList = ActApp.ActFramework.Activities.GetActivityList(sCriteria, Nothing, Now.Date, Now.Date.AddDays(1)) 'loop the activities For Each activity As Act.Framework.Activities.Activity In aList 'you can access activity details through its properties, some examples below MsgBox(activity.Type.Name & " " & activity.StartTime & " " & activity.EndTime) 'we can get the contacts associated with the activity for things like email addresses Dim contacts As Act.Framework.Activities.ActivityContactCollection = activity.ActivityContacts Dim ids As New ArrayList For Each activityContact As Act.Framework.Activities.ActivityContact In contacts ids.Add(activityContact.Key) Next 'get the contacts as a list Dim cList As Act.Framework.Contacts.ContactList = ActApp.ActFramework.Contacts.GetContactsByID(Nothing, ids.ToArray(GetType(System.Guid))) 'do something with the contacts For Each Contact As Act.Framework.Contacts.Contact In cList MsgBox(Contact.Fields("Contact.E-mail", False)) Next Next