Community
Showing results for 
Search instead for 
Do you mean 
Reply

Act 2007 - TBL_CONTACT - What is the name if the unique ID for this table?

New Member
Posts: 4
Country: United States

Act 2007 - TBL_CONTACT - What is the name if the unique ID for this table?

I want to create a VB.NET DataGrid that contains some columns from the TBL_CONTACT table and have done so successfully.

The one thing that I need though, is the unique identifer for each contact.   What is the name of this column?

 

I've tried guid, id, contact_id, uid... all invalid.

 

 Dim contactID As ContactFieldDescriptor

contactID = ACTFM.Contacts.GetContactFieldDescriptor("TBL_CONTACT.ID", True)

 

In the SDK samples app there is a utility to list all contact fields, but the unique id is not included in that list.

 

I could just keep on guessing, but if anyone can save me that hassle, I'd sure appreciate it.

 

thanks,

Bob

Nickel Super Contributor
Posts: 441
Country: UK

Re: Act 2007 - TBL_CONTACT - What is the name if the unique ID for this table?

As far as I am aware it can only be accessed through the Contact.ID property.

 

Tom

New Member
Posts: 4
Country: United States

Re: Act 2007 - TBL_CONTACT - What is the name if the unique ID for this table?

[ Edited ]

Thank you, Tom!

 

You gave me the spark I needed to get this done.

 

After building the contact list and assigning it as the data souce for the grid, I simply iterate through the zero based cList, obtaining the .ID property and inserting it into a pre-existing column in the grid.

 

Sweeeet!

 

' FieldDescriptors defined here (not shown)

 Dim cList As ContactList

cList = ACTFM.Contacts.GetContacts(Sort)

' FieldDescriptors added here (not shown)

DataGrid1.DataSource = cList

lnRetVal = cList.Count

Dim cID As String, nLoop As Int16 
For nLoop = 0 To lnRetVal - 1

   cID = cList.Item(nLoop).ID.ToString

   DataGrid1.Item(nLoop, 10) = cID

Next

Message Edited by USFbobFL on 11-06-2008 09:05 AM
Message Edited by USFbobFL on 11-06-2008 09:06 AM
New Member
Posts: 4
Country: United States

Re: Act 2007 - TBL_CONTACT - What is the name if the unique ID for this table?

[ Edited ]

Update:

The code in my first post, I soon discovered, was not ideal.

Since the DataGrid was bound, it was not good to replace the dummy cell contents.

I did away with the datagrid and used a DataGridView instead (unbound).

It took a little while to figure out the correct syntax for pulling the data from the ContactList, but here is the final code: 

 

 Dim cList As ContactList

cList = ACTFM.Contacts.GetContacts(Sort)

lnRetVal = cList.Count

DataGridView1.Rows.Add(lnRetVal)

Dim cID As String, nLoop As Int16 
For nLoop = 0 To lnRetVal - 1

   cID = cList.Item(nLoop).ID.ToString

   DataGridView1.Item(0, nLoop).Value = cList.Item(nLoop).Fields.Item("TBL_CONTACT.COMPANYNAME", True)  
   DataGridView1.Item(1, nLoop).Value = cList.Item(nLoop).Fields.Item(
"TBL_CONTACT.FULLNAME", True)

   DataGridView1.Item(2, nLoop).Value = cList.Item(nLoop).Fields.Item("TBL_CONTACT.BUSINESS_PHONE", True)  

   DataGridView1.Item(3, nLoop).Value = cList.Item(nLoop).Fields.Item("TBL_CONTACT.MOBILE_PHONE", True)

   DataGridView1.Item(4, nLoop).Value = cList.Item(nLoop).Fields.Item("TBL_CONTACT.BUSINESS_LINE1", True)  

   DataGridView1.Item(5, nLoop).Value = cList.Item(nLoop).Fields.Item("TBL_CONTACT.BUSINESS_CITY", True)

   DataGridView1.Item(6, nLoop).Value = cList.Item(nLoop).Fields.Item("TBL_CONTACT.BUSINESS_STATE", True)  

   DataGridView1.Item(7, nLoop).Value = cList.Item(nLoop).Fields.Item("TBL_CONTACT.BUSINESS_POSTALCODE", True)

   DataGridView1.Item(8, nLoop).Value = cList.Item(nLoop).Fields.Item("TBL_CONTACT.BUSINESS_EMAIL", True)

   DataGridView1.Item(9, nLoop).Value = cID

Next

DataGridView1.ReadOnly = True

Message Edited by USFbobFL on 11-06-2008 10:00 AM