EnduranceMan
Programmer
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:
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