Community
Showing results for 
Search instead for 
Do you mean 
Reply

Best way to pull up the current contact

Tuned Listener
Posts: 10
Country: Canada

Best way to pull up the current contact

Can anyone provide me with the C# code that can pull up the active contact record and that contact's name and address? I suppose it is two steps: Find the current contacts guid, then search on that guid for name and address.

 

Thanks.

 

Frank Buell
Source 1 Consultants
Montreal, Canada
Copper Super Contributor
Posts: 112
Country: Australia

Re: Best way to pull up the current contact

 

Dim c As Contact = ActApp.ApplicationState.CurrentContact

so in c# thats something like: c Contact = ActApp.ApplicationState.CurrentContact;

this gets the current contact.. then to get the fields

c.FullName or c.FirstName c.LastName

to get the address its like

ActApp.ApplicationState.CurrentContact.ContactFields("TBL_CONTACT.BUSINESS_CITY", 0)

so i think c# is something like 

ActApp.ApplicationState.CurrentContact.ContactFields["TBL_CONTACT.BUSINESS_CITY", 0];

 

sorry im rusty on my C# conversion from VB