Adam Haeder requested to see some sample code for accessing address information via the Netsuite Webservices API. So here it is:
<?php
//$customer is nsComplexObject retrieved from a search or a get.
if (isset($customer->nsComplexObject_fields['addressbookList'])) {
$CustomerAddressbookList = $customer->getField('addressbookList');
$addresses = $CustomerAddressbookList->getField('addressbook');
foreach ($addresses as $CustomerAddressbook) {
$city = $CustomerAddressbook->getField('city');
$state = $CustomerAddressbook->getField('state');
$nsCountry = $CustomerAddressbook->getField('country');
$zip = $CustomerAddressbook->getField('zip');
$street = $CustomerAddressbook->getField('addr1');
$street2 = "";//filled in later
$attention = $CustomerAddressbook->getField('attention');
$phone = $CustomerAddressbook->getField('phone');
if ($phone === null) {
$phone = $customer->getField('phone');//if the address didn't have a phone, use the customer one
}
$nsID = (int) $CustomerAddressbook->getField('internalId');
$defaultShipping = (bool) $CustomerAddressbook->getField('defaultShipping');
$defaultBilling = (bool) $CustomerAddressbook->getField('defaultBilling');
if (isset($CustomerAddressbook->nsComplexObject_fields['addr2'])) {
$street2 = $CustomerAddressbook->getField('addr2');
}
$addressee = $CustomerAddressbook->getField('addressee');
}
}
?>

Pingback: Joe Motacek » Blog Archive » Joomla 2.5 Extension Development – Working with the NetSuite Webservice