Community
Showing results for 
Search instead for 
Do you mean 
Reply

How to get Contact's address from C#?

Accepted Solution Solved
New Member
Posts: 7
Country: Australia
Accepted Solution

How to get Contact's address from C#?

Hi, I have loaded the contact and can read following fields using the following:

 

string address1 = (string)john.Fields["address_1", Act.Framework.MutableEntities.FieldNameType.Alias];

string address2 = (string)john.Fields["address_2", Act.Framework.MutableEntities.FieldNameType.Alias];           

string city = (string)john.Fields["city", Act.Framework.MutableEntities.FieldNameType.Alias];           

string state = (string)john.Fields["state", Act.Framework.MutableEntities.FieldNameType.Alias];            

string postcode = (string)john.Fields["postcode", Act.Framework.MutableEntities.FieldNameType.Alias]; // THROWS ERROR         

string country = (string)john.Fields["country", Act.Framework.MutableEntities.FieldNameType.Alias];           

string title = (string)john.Fields["Title", Act.Framework.MutableEntities.FieldNameType.Alias];           

string department = (string)john.Fields["Department", Act.Framework.MutableEntities.FieldNameType.Alias];           

string salutation = (string)john.Fields["salutation", Act.Framework.MutableEntities.FieldNameType.Alias];           

string phone = (string)john.Fields["phone", Act.Framework.MutableEntities.FieldNameType.Alias];            

string fax = (string)john.Fields["fax", Act.Framework.MutableEntities.FieldNameType.Alias];  // THROWS ERROR

string mobile = (string)john.Fields["mobile", Act.Framework.MutableEntities.FieldNameType.Alias]; // THROWS ERROR     

string website = (string)john.Fields["website", Act.Framework.MutableEntities.FieldNameType.Alias]; // THROWS ERROR

 

But those 4 fields "postcode" "fax" "mobile" "website" all throw errors. Anyone know how to read these fields?


Accepted Solutions
Solution
Accepted by topic author simon1
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: How to get Contact's address from C#?

[ Edited ]

Hi,

 

I think the alias name are:

 

Postcode = ZIP_CODE

Fax = FAX_PHONE

Mobile =MOBILE_PHONE

Website = WEB_SITE

 

HTH

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog

View solution in original post


All Replies
Solution
Accepted by topic author simon1
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: How to get Contact's address from C#?

[ Edited ]

Hi,

 

I think the alias name are:

 

Postcode = ZIP_CODE

Fax = FAX_PHONE

Mobile =MOBILE_PHONE

Website = WEB_SITE

 

HTH

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Employee
Posts: 1,163
Country: USA

Re: How to get Contact's address from C#?

[ Edited ]

Looks as though the only issue above is that the alias for those field descriptors is incorrect.

 

Contact contact = _ActApp.ApplicationState.CurrentContact;

DBFieldDescriptor StateField = _ActApp.ActFramework.Contacts.GetContactFieldDescriptor("STATE", Act.Framework.MutableEntities.FieldNameType.Alias);

DBFieldDescriptor BusinessZipField = _ActApp.ActFramework.Contacts.GetContactFieldDescriptor("ZIP_CODE", FieldNameType.Alias);

DBFieldDescriptor FaxNumField = _ActApp.ActFramework.Contacts.GetContactFieldDescriptor("FAX_PHONE", FieldNameType.Alias);

DBFieldDescriptor MobileNumField = _ActApp.ActFramework.Contacts.GetContactFieldDescriptor("MOBILE_PHONE", FieldNameType.Alias);

DBFieldDescriptor WebsiteField = _ActApp.ActFramework.Contacts.GetContactFieldDescriptor("WEB_SITE", FieldNameType.Alias);

 

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 7
Country: Australia

Re: How to get Contact's address from C#?

That worked. Cheers.