Community
Showing results for 
Search instead for 
Do you mean 
Reply

Fairly new to ACT! - Software Developer looking to access database directly

Bronze Super Contributor
Posts: 1,284
Country: USA

Re: Fairly new to ACT! - Software Developer looking to access database directly

[ Edited ]

Change "hostFramework" to "ACTFramework" and it should compile.

 

I will edit the previous post to change that typos.

 

-- Jim

New Member
Posts: 19
Country: USA

Re: Fairly new to ACT! - Software Developer looking to access database directly

[ Edited ]

Thanks, my code works now.  Only issue is (and it's probably a Visual Studio problem), is that when I go to build with the DLLs in my references (Act.Framework, Act.UI, Act.UI.Core), it tells me "The type or namespace 'Act' could not be found (are you missing a using directive or an assembly reference?)"

 

I've set those DLLs to Copy Local = True, and Specific Version = False, but still no luck building...

Bronze Super Contributor
Posts: 1,284
Country: USA

Re: Fairly new to ACT! - Software Developer looking to access database directly

Copy local should be FALSe since the ACT DLL are in the GAC.

 

-- JIm

New Member
Posts: 19
Country: USA

Re: Fairly new to ACT! - Software Developer looking to access database directly

Found it about 3 seconds after I posted...

 

http://stackoverflow.com/questions/4286599/referenced-project-gets-lost-at-compile-time

 

Thanks though!

New Member
Posts: 19
Country: USA

Re: Fairly new to ACT! - Software Developer looking to access database directly

Ok, hopefully just one more thing.  How would I get the guid of the particular contact I'm trying to find?  I'd like to look up the contact by email, and have the guid to pass to the GetContactsByID method...

New Member
Posts: 19
Country: USA

Re: Fairly new to ACT! - Software Developer looking to access database directly

Ok, I've got it working, thanks Jim!

 

Here's the code I'm using:

 

            ActFramework ACTFramework = new ActFramework();
 
            try
            {
                ACTFramework.LogOn(@"\\Server\ACT For Web\Databases\db.pad""user""pass");
 
                MutableEntityFieldDescriptor mefd = (MutableEntityFieldDescriptor)ACTFramework.Contacts.GetFieldDescriptor("TBL_CONTACT.BUSINESS_EMAIL");
                CriteriaColumn col = ACTFramework.Lookups.GetCriteriaColumn(mefd);
                Criteria[] criteria = new Criteria[1];
                criteria[0] = new Criteria(LogicalOperator.End, 0, 0, col, OperatorEnum.Contains, "email@address.com");
                ContactLookup cLookup = ACTFramework.Lookups.LookupContactsReplace(criteria, truetrue);
                ContactList cl = cLookup.GetContacts(null);
                Act.Framework.Notes.NoteType notetype = new Act.Framework.Notes.NoteType(Act.Framework.Notes.SystemNoteType.Note);
                ACTFramework.Notes.CreateNote(notetype, "Note to add to account"DateTime.Now, false, cl[0]);
            }
            catch
            {
                throw new Exception("There was a problem adding the contact note.  Please add this note manually:" + Environment.NewLine + "Note to add to account");
            }
            finally
            {
                ACTFramework.LogOff();
            }