11-20-2008 07:44 AM
I'm having a problem figuring out how to add a History/Note entry to a contact using the ACT!2009 SDK in Visual Studio. Can someone give me a rough outline of how to do this. I am very familiar with VB.NET and using other SDK/API packages. What dll(s) would need to be added to the project. And is there a specific method/function for this or would it be better handled by a direct INSERT statement to the database backend? Any information would help.
I'm sure once I get headed in the right direction I'll be fine. Thanks.
11-21-2008 01:09 AM
Taken straight from the sdk samples... have a look through the documented code snippets etc....Hope it helps.
Overloads Public Function CreateNote(ByVal noteType As NoteType, ByVal noteText As String, _ ByVal displayDate As Date, ByVal isPrivate As Boolean, ByVal contact As Contact) As Note 'Example 1 Dim nType As NoteType Dim sText As String Dim displayDate As Date Dim isPrivate As Boolean Dim cContact As Contact . . . ActFwk.Notes.CreateNote(nType, sText, displayDate, isPrivate, cContact) 'Example 2 'This example creates a note on the MyRecord Dim cContact As Contact Dim sText As String Dim nType As NoteType cContact = ActFwk.Contacts.GetMyRecord() sText = "Rev limiter? I thought that was the shift indicator." nType = New NoteType(SystemNoteType.Note) ActFwk.Notes.CreateNote(nType, sText, System.DateTime.Now, False, cContact)
11-21-2008 06:26 AM
Thanks Tom. But seeing your solution made me realized I am getting stuck one step earlier. I think I am using the wrong DLL or instantiating the ACT Framework object incorrectly. Because I don't see a ".Notes" member in my framework object. The dll I am adding to my project is Act.Framework.Interop.dll
and I am seting up the object as follows:
Dim oACT As New Act.Framework.Interop.ActFramework
So when I type oAct. I see:
But no oAct.Notes
I must be starting off on the wrong foot somewhere. Do you see my error?
11-21-2008 06:36 AM
Yes, you need to reference act.framework.dll and act.shared.collections.dll, if you are integrating with the UI you would also need act.ui.dll and act.ui.core.dll. All of these can be found on the act installation media, copy them from the cd to a folder on your hard drive and then reference them from there. Bin the interop reference and create a new instance like this instead:
dim actfwk as new act.framework.actframework
... follow previous example from here...
11-21-2008 10:00 AM
All of these can be found on the act installation media
Ah, silly me... I assumed that installing ACT! would put these DLLs in the ACT! program folder. I'll dig up the CD and do as you suggest. Thank you!
12-24-2008 09:07 PM - edited 12-24-2008 09:08 PM
Thanks Tom. Now I am part way there. I am able to attach history and notes to MY contact record, but how can I attach to some other specified record in the database? in other words, to get my contact I use this:
Dim oContact As Act.Framework.Contacts.Contact
oContact = ActFwk.Contacts.GetMyRecord()
But how can I assign some other record to oContact? I have been trying to figure out ContactList and GetContactbyID, but have been unsuccessful and can't find any examples that I understand.
I don't know if this helps but the appplication that I am trying to intigrate with ACT! does store what might be an ACT contact ID number in its database. But I don't know enough about ACT to be able to verify this, it could just be some number that it dumps to a userdef field in ACT to maintain a link, I don't know. Maybe you'd recognize it? The ID numbers look something like this: 43ddc085-708e-4227-ad38-f1f107f76c5d
If there were a way to assign oContact based on that ID number I'd be set. Could you point me in the right direction?