--- title: "Add Sales Invoices to CustCollectionLetter Using Document Handling" slug: "add-salesinvoices-to-custcollectionletter-document-handling" description: "Lasernet Document Handling allows you to store a document in docuref/Attachments. This article shows how to add sales invoices to CustCollectionLetter." updated: 2026-02-05T16:18:30Z published: 2026-02-05T16:18:30Z canonical: "kb.lasernetgroup.com/add-salesinvoices-to-custcollectionletter-document-handling" --- > ## Documentation Index > Fetch the complete documentation index at: https://kb.lasernetgroup.com/llms.txt > Use this file to discover all available pages before exploring further. # How Do I Add Sales Invoices to CustCollectionLetter Using Document Handling? Lasernet’s Document Handling enables users to store a document in **DocuRef**/**Attachments**. This article will explain how to add sales invoices to **CustCollectionLetter** using this feature. > [!NOTE] > Note > > Another solution is available to pick a file from the Lasernet **Archive**. For more information, visit [this guide page](/v1/docs/attachments). ## Add Document Handling to the Sales Invoice Report - Configuration 1. Select the sales invoice report, and click **Setup** > **Document handling**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-2ULAK8PR.png) 1. Click **New** and add the reference table where you want the **SalesInvoice** to be stored in FO. > [!NOTE] > Note > > If the document should be sent to the customer afterward, set the **Restriction** to **External**. 1. From the **Document type** dropdown, choose **Original**. This way, you only store the Original posted and no Proformas. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-Y8WLZWI2.png) 1. Create a **Description**, **Note**, and **Values used in notes**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-RDH54Q72.png) 1. Print a **SalesInvoice** and view the attachments from the **CustInvoiceJour**. The document is now stored where required. Here you can see the **Description** and the value in notes showing the **invoiceId**: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-POYJHP0T.png) ## Add CustInvoiceJour Table to CustCollectionJour Query Wizard The reference table in which the attachments are stored must be added to the **CustCollectionJour** report. From the ribbon, click **Query wizard** and add the **CustInvoiceJour** table to **CustCollectionJourTmp**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-949RWDLT.png) The relations are displayed as follows: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-WRCGH4WE.png) ## Attach the SalesInvoice to the Collection Letter 1. Navigate to **Lasernet** > **Reports**, find the **Collection letter**, and click **Attachments**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-9QII3KKV.png) 1. Click **New** to create a new line. 2. Add the **Attachment reference table** (in this case, the **CustInvoiceJour** table) and include only attachments with the restriction **External** (the same restriction as set up in the Document Handling step). ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-OM68UDCH.png) The sales invoices will be attached to your **CustCollectionLetter** emails as follows: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-RHIMPVS2.png) ## Additional Information ### Attachment Condition In a **Collection letter** process, there are several interactions with the customer: **Collection letter 1** **Collection letter 2** **Collection letter 3** Etc. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-32IX15O9.png) Consider whether you need to include the SalesInvoices in all interactions. If you decide to only include them in a specific interaction, add a condition on attachments as follows: 1. Choose **Query** in **Condition**. 2. Click the **Select** button. The **Inquiry** opens. 1. Choose table **CustCollectionLetterJour** and field **CollectionLetterCode**. Choose when you want the attachments to come. You can choose one or several. In this example, we have chosen to only include the attachments in the first **Collection letter** to the customer. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-59FKK4CL.png) 1. Click **OK**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-IKGO8JWE.png) This should also be completed in FreeTextInvoice to save it to DocuRef. Keep in mind that at setup time, the system has not yet created the invoice PDFs in DocuRef for reports that have already been printed. You can mark them in the Invoice journal and force a rerun to send them through Lasernet FO Connector with the new settings, then they will get to DocuRef. Use a filter, mark all, or several in the Invoice journal, and resend to save time. ### Attachments with LACAddAttachments() The above setup will add attachment details to the **JobInfo** section of the **CustCollectionLetter** XML. Our Lasernet Default Configuration processes attachments from this section of the XML. However, attachments can be added on the line level of the **CustCollectionLetter** report using the context method **LACAddAttachments()**. > [!NOTE] > Note > > Using this method for attachments will require modification of the Lasernet Configuration to process the relevant sections of the XML. 1. Open the **Query wizard** for the **CustCollectionLetter** report. 2. Add **Docuref** to **CustInvoiceJour**. > [!NOTE] > Note > > Since we are on the line level for the Invoice numbers, several invoice attachments can be added to our **CustCollectionLetter**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-MBIAUMKC.png) The relations are displayed as follows: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-G8MAML5U.png) 1. Add the field **LACAddAttachments()** to the query and then click **Finish**. This field allows the **DocuRef** table to be added several times per line.