Addresses in business objects

Addresses are Referenced objects. To understand the connections here, it is necessary to understand the principle of referenced objects.

Addresses are stored in business objects in company and address attributes. There is only one possible company and address attribute per company type.

The company and address attribute can contain either an address (address node), a company (company node) or both an address and a company.

A company always contains an address.

►NOTE◄ The class of the attribute actually used depends on the business object, in the following XML example, e.g. ShipmentCompanyAddress in shipments.


Example shipment XML (shortened ...)
<?xml version="1.0" encoding="UTF-8"?>
<shp:Shipment ...>
...
<attributes>
<shp:ShipmentCompanyAddress >
<value companyType="CNE">
<!-- Nur Adresse -->
<address name1="Hans Huber e.K." name2="Metallbau" street1="Hauptstraße" streetNo="15" ...>
<attributes/>
</address>
</value>
</shp:ShipmentCompanyAddress>
<shp:ShipmentCompanyAddress ...>
<!-- Nur Firma incl. Adresse-->
<value companyType="RFW">
<company ...>
...
<address name1="Zentrallager 1" street1="Musterstraße" streetNo="20" ...>
<attributes/>
</address>
</company>
</value>
</shp:ShipmentCompanyAddress>
<shp:ShipmentCompanyAddress ...>
<value companyType="FWD">
<!-- Firma incl. Adresse und zusätzlich mit abweichender Adresse -->
<company ...>
...
<attributes/>
<address name1="Smart Logistics" street1="Neue Straße" streetNo="11" ...>
<attributes/>
</address>
</company>
<address name1="Smart Logistics" street1="Alte Straße" streetNo="7a" ...>
<attributes/>
</address>
</value>
</shp:ShipmentCompanyAddress>
</attributes>
<lineItems/>
</shp:Shipment>


The principle of referenced objects has the following effects:

If a company's address changes, this has no effect on the address in the address nodes of the company and address attribute.

Changing the address of the address node in the company and address attribute has no effect on a possible entry in an address book.

If an entry in an addressbook changes, this has no effect on the address in the address-node of business objects, which refer to this address. In this case a new address is created in the addressbook.

Changing the address of the address node in the company and address attribute has no effect on the address of the company within the same company and address attribute.

This difference must be taken into account, especially when using the data in print documents.

If you always want to use the current address of a company at the time of printing (e.g. as a current letterhead), you must access the address node within the company node.

Possible X-Path expression: attributes/shp:ShipmentCompanyAddress/value[@companyType='FWD']/company/address/@street1

The determined value from the sample XML is here: the new street.

If you want to use the last used address at the time of printing (e.g. as stored delivery address), you have to access the address node.

Possible X-Path expression: attributes/shp:ShipmentCompanyAddress/value[@companyType='FWD']/address/@street1

The determined value from the sample XML is then: the old street.