Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACT! contact retrieval help!

Status
Not open for further replies.

EnduranceMan

Programmer
Mar 12, 2008
13
GB
Hi, im am busy researching the new ACT version.
A previous employee had written a few sample methods, the following outlines a method to return contact information:

Code:
public static string getFullNameFromID(string pUniqueKey)
        {
            Boolean found = false;
            string name = "";
            ArrayList allContacts = new ArrayList();

            //Define objects 
            Act.Framework.Contacts.ContactList oContactList;
            Act.Shared.Collections.SortCriteria[] oSortCriteria;
            Act.Framework.Contacts.ContactFieldDescriptor oFieldDescriptor;

            //Get Field Descriptor for Contacts table 
            oFieldDescriptor = FrameWork.oFrameWork.Contacts.GetContactFieldDescriptor("TBL_CONTACT.FULLNAME", true);

            //Build ascending Sort Crietria 
            oSortCriteria = new Act.Shared.Collections.SortCriteria[] { new Act.Shared.Collections.SortCriteria(oFieldDescriptor, System.ComponentModel.ListSortDirection.Ascending) };

            //Get Collection of Contacts 
            oContactList = FrameWork.oFrameWork.Contacts.GetContacts(oSortCriteria);

            foreach (Act.Framework.Contacts.Contact contact in oContactList)
            {
                if (Convert.ToString(contact.ID) == pUniqueKey & !found)
                {
                    name = contact.FullName;
                    found = true;
                }
            }[code/]

The method requires a parameter - pUniqueKey, where would i find the primary key for each contact in act?
Thanks for any help.
Adrian
 
Iv managed to retrieve some form of ID:

test = oContact.ID.ToString();

However this returns a large value which looks like a registry key: 43897773-37ad-4ac1-95c4-ce4f6ca3784c

Surely this isnt the primary key for a contact in ACT? Seems a bit crazy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top