11-22-2010 09:12 AM
I want to be able to create a new History record for a Contact, and add an Attachment at the same time. The attachment will be a WORD or PDF document, and will be in a Folder other than the ACT! Attachments folder (if possible).
I am able to get the Contact info in .NET - I just need to create the code to create the History record and add an Attachment reference in the History record.
I would appreciate any help available, and VB code samples if possible.
11-22-2010 03:15 PM
It would be nice to be able to use Act.Framework.Histories.History, but the Act.Framework.SupplementalFiles.Attachment is protected so you cant create an attachment object!!!!!!!!!!!! (in 2011 it is)
inside i use something like this:
Dim g(0) As Guid
g(0) = ActApp.ActFramework.Contacts.GetMyRecord.ID
Dim cl As Act.Framework.Contacts.ContactList = ActApp.ActFramework.Contacts.GetContactsByID(Nothing, g)
ActApp.UIHistoryManager.AttachFile(cl(0), "Description Text", "C:\Path\Filename.txt")
you just need a CONTACT object, description text, and file info.. thats it
11-26-2010 10:38 AM
Firstly let me say I haven't tested this so I might be talking out of my ****!
To create an Attachment you could use the SupplementalFileManager (from ActFramework.SupplementalFileManager) to:
SupplementalFileManager sFM = oFram.SupplementalFileManager;
Attachment att = sFM.CreateAttachment(AttachMate.History,filePath, displayName, False);
oFram.Histories.CreateHistory(contact, activityOccurID, histType, isPrivate, displayDate, endDate, regarding, details, att) ;
Let me know if I've got it all horribly wrong!