Page 1 of 1

Alternative Address

Posted: 12 Feb 2015, 16:40
by Rufus1983
Hi,

I was wondering if you knew if it is possible to pull information from delivery addresses set up on an account, specifically I am looking to get the contact information from the following:

Image

Do you know the table/data field location for this information?

Thanks,

Rupert

Re: Alternative Address

Posted: 13 Feb 2015, 10:10
by brucedenney
There is a separate table for delivery addresses.

SALES_DEL_ADDR

Re: Alternative Address

Posted: 19 Feb 2015, 09:27
by Rufus1983
Hi Bruce,

We have a number of customers who have multiple branches, but make all payments via head office. Due to payment issues, it is considerably easier for us to set the company up with a single account and have each branch as a separate delivery address on the SALES_DEL_ADDR table. This is fine for the most part, but it does create a minor issue with invoicing.

There is one customer which requires the invoices to be emailed to branch who will then submit to head office for payment. The delivery address is selected from the branch list on the order details tab on the invoice and the delivery address is correctly displayed, however it does not pull through the SALES_DEL_ADDR.EMAIL field which is needed to send the pdf.

The SALES_DEL_ADDR table is linked to the invoice layout (joined on SALES_LEDGER.ACCOUNT_REF [ParentOuter] > SALES_DEL_ADDR.ACCOUNT_REF [Inner])

Can you let me know what I'm doing wrong, or if you know of an alternative way to pull the SALES_DEL_ADDR.EMAIL field to an invoice?

Thanks,

Rupert

Re: Alternative Address

Posted: 19 Feb 2015, 14:09
by brucedenney
You need to make a compound key out of all the account and delivery lines in the invoice

INVOICE.ACCOUNT_REF,INVOICE.DELIVERY_NAME,INVOICE.DELIVERY_ADD1 and so on,

and then use that as the key to link to the same compound key in the SALES_DEL_ADDR table.

SALES_DEL_ADDR.ACCOUNT_REF,SALES_DEL_ADDR.NAME,SALES_DEL_ADDR.ADDRESS_1 and so on.

If you know all the accounts have unique DELIVERY_NAME or other field then you could make it a more simple key.

It is not perfect If anyone edits the delivery address, then the link breaks.

But what you are trying to do is "difficult"

I would try and do it a different way if you can. You want to avoid linking the tables it is a pain and it is inconsistent. Perhaps you could sacrifice the last line of the address to be the email address?

Use conditional formatting to suppress printing of the last line of the address if it contains an @ sign

On the "to" address use an expression to use address line 5 if it contains an @ sign otherwise to use the email address off the account.

Re: Alternative Address

Posted: 19 Feb 2015, 16:22
by Rufus1983
Thanks Bruce, I decided to go with Option 2 - shifted the post code up to line 4 at the expense of county, which is pretty much entirely useless these days anyway!

Rupert