API Method for accessing Clients adress

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

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: Client Properties

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: Address Members

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

c.MailToAddress.Postal

Thanks John,

yet again I miss the art of the obvious !!

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

Cheers!