Clever Document Delivery allows you to easily define additional attachments that should be sent when certain records are processed. For example, send an attachment of your terms and conditions with each invoice or send unpaid invoices with a customer statement or reminder letter.

Attachments are defined in the Attachments tab of the "Doc Delivery Document Type" card. Attachments can be created either from a report or a static attachment that has been uploaded to the "Doc. Delivery Attachments" page.

A question that customers sometimes have is how to setup different attachments to appear per customer or vendor.

Let’s imagine that we have two different attachments that must be send out with Sales Invoices. Only one of the attachments should be sent with each invoice and we need to decide per customer which it is.

1. Upload Attachments

First, we need to upload those attachments to the "Doc. Delivery Attachments" page. Typically they will be PDF files but many other file types are supported.

I have given the attachments the codes 'ONE' and 'TWO' in my example.

2. Create a Document Type Field

Now to add an attachment to the sales invoice "Document Type". First, we need a way to decide which of these two we are going to send for each customer. We can use the 'Custom Values' features for this.

Create a new line in the Fields section of the "Doc. Delivery Document Type" page. As an example, I have 'ADDATTACH'. Click on Manage, Field Lines to configure this field.

The Document Type Field Lines determine how the value of this field will be calculated when a record is submitted to Clever Document Delivery for processing. In this case I will take the value from the "Custom Values" table.

3. Create a Document Type Attachment

Next, create a new record in the Attachments table. I’ve selected an Attachment Type of 'Attachment' to indicate that I’m going to attach a file from the "Doc. Delivery Attachments" page.

I must tell the system which attachment I want to attach by populating the Attachment Code. I could select 'ONE' or 'TWO' from the dropdown but that would always attach the selected file.

Instead I will enter '[[ADDATTACH]]'. This tells the system to use the value of my ADDATTACH field created in the previous step. This placeholder will be replaced with the value that has been calculated for the ADDATTACH field for each invoice that is processed.

I am also using the '[[ADDATTACH]]' placeholder for the Attachment Name. When the file is attached to the email it will be named either “Attachment ONE.pdf” or “Attachment TWO.pdf” as appropriate. 

4. Enter Custom Values

Finally, we can enter the required value for each customer in the "Custom Value" window to confirm which of the 2 available attachments must be used. Click on Custom Value at the top of the "Doc. Delivery Document Type" page. Create a record for each customer that must receive one of these attachments, selecting 'ADDATTACH' as the Field Code and enter either 'ONE' or 'TWO' as the Value.

5. Test

Finally, you can test this. Ensuring Preview before Sending is turned on, navigate to the "Posted Sales Invoices" page, highlight a record and use the Send Email action. Check the Attachments table at the bottom of the "Email Preview" page to ensure that the correct attachment has been used as defined in Custom Values.

Customer & Vendor Templates

An additional feature within Document Delivery allows for specific documents to be added by default within the Customer and Vendor Cards, which can also be added when creating a new Customer or Vendor via a Template. 

Opening a Customer or Vendor Template now shows the field Attachment Code in the Document Delivery FastTab meaning default attachment documents can be set up much quicker. 

To ensure these can be used with Document Delivery, rather than having to add them into "Custom Values", the "Document Type" card can simply be updated. 

Opening the "Document Type" card (in this example SO) and looking at the Attachments FastTab, you'll have the Attachment Type of 'Report' as an existing line. Add a new line of 'Attachment', where Attachment Code you manually type in the value '[[ATTACH]]' which refers to the field the system needs in order to link the document. In the Attachment Name you can enter how you want the description of the attachment to read for the end user. 

Now, scroll down the "Document Type" page to the Fields FastTab and highlight the line that shows Code as 'ATTACH'. Click into 'Manage' and 'Field Lines' and add a new entry in the Document Type Field Lines FastTab. 

Ensure Source Type is 'Linked Table', Source Type No is '1' (this is the same, whether it be for Customer or Vendor) and where Field No is '9093432' which is a lookup to the Attachments field on the Customer/Vendor card. 

Where this is now linked, when processing the "Document Type", any standard attachments that were setup using "Custom Values" will still send and this new attachment will only send where the Attachment Code field on the "Customer" or "Vendor" page is populated. Therefore this is a simpler way of connecting a default document per Customer or Vendor that gets sent with documents using much less setup.