API Method for accessing Clients adress


#1

Hi,

I am writing a report and need to access the address class.

I get the client ID. But I cannot see how to tie that to the address class.

So:
Guid gClientID=Client.IDFromName(GetCurrentColumnValue(“LT_O_Client”).ToString());
Client c = Client.GetItemNoMRU(gClientID);//NoMRU so that this client won’t appear in the recent items drop down box in AyaNova UI

Lets say I want to get Address.Postal value. How would I do it ?

Thanks


#2

Hi Martin, the Client object contains the MailToAddress and GoToAddress fields which are Address objects.

If you look in the api documentation http://api.ayanova.com/ the client object is documented with it’s properties here: http://api.ayanova.com/html/Properties_T_GZTW_AyaNova_BLL_Client.htm

As you can see there, the Client object has a GoToAddress and a MailToAddress property for each address type, that’s how you access it.

Address object properties are here: http://api.ayanova.com/html/AllMembers_T_GZTW_AyaNova_BLL_Address.htm

In you sample code you have the Client object in variable c so to access the address postal value:

c.MailToAddress.Postal


#3

Thanks John,

yet again I miss the art of the obvious !!


#4

No worries Martin; that’s why we’re here. :slight_smile:

Cheers!