Shipping/Delivery Addresses
Shipping or delivery addresss can be maintained for sales to record where the item was shipped too.
Database
The field sale.deliveryphyskey links to sale_delivery.physkey
The table sale_delivery has a record for each sale, even if the same address is used multiple times. This duplication is intentional so that actual values can be historically retrieved.
The table contactdetails holds reference addresses that can be used as a search function. This table holds contact details for several areas, so that a customer and a supplier might both point to the same record.
To scan for all reference delivery addresses for a customer, use a query similiar to this
select ... from contactdetails, multilink_all where contactdetails.physkey = multilink_all.physkeyc and multilink_all.physkeyp = { Customers Physkey } and multilink_all.linktype = 1
To retrieve all delivery addresses used by a customer
select ... from sales, sale_delivery where sales.deliveryphyskey = sale_delivery.physkey and sales.cid = { Customers Id }